home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Magazin/MacEasy 19
/
Mac Magazin and MacEasy Magazine CD - Issue 19.iso
/
Wissenschaft & Technik
/
BibTeX ƒ
/
Source code
/
bibtex.cc
< prev
next >
Wrap
Text File
|
1996-02-18
|
232KB
|
10,172 lines
//###################################################################
//
// FILE: "BibTeX.cc"
// created: 2/2/96 {10:03:20 am}
// last update: 18/2/96 {8:21:17 pm}
// Author: Vince Darley
// E-mail: <mailto:vince@das.harvard.edu>
// mail: Division of Applied Sciences, Harvard University
// Oxford Street, Cambridge MA 02138, USA
// <http://www.das.harvard.edu/users/students/Vincent_Darley/>
//
// This is the basic source to BibTeX, grabbed off an old mac port
// on CTAN in C, which I ported to C++ (proper function
// declarations and prototypes), and ported further to compile
// under Codewarrior 8.
//
// The code and porting is a bit of a mess. First because the code
// comes out of web2c, and second because this is a port of a port.
// Most of the work is actually just done by a bunch of '#define's
// which get rid of all unix stdio stuff.
//
//###################################################################
// uncomment this to have a close look
// at what's going on and generate
// enormous .blg files
//#define TRACE
#undef __profile__
#ifdef __profile__
#pragma profile on
#endif
// we call WaitNextEvent occasionally
#define GIVE_UP_TIME
#include "BibTeX.h"
jmp_buf jmp9998, jmp32; int lab31=0;
/* 9998 9999 31 32 9932 */
#include "BibTeX.p"
#include "bibutils.h"
#include "globals.h"
#include "file-io.h"
#include <string.h>
#define ReverseFPuts(a,b) FPutS(b,a)
#define fclose(a) CloseFile(a)
extern const char *aux_fn;
#ifdef stdout
#undef stdout
#endif
// so that stdout actually goes to a log window
#define stdout 0
//#define lineread(f,size) ReadLine(f)
integer bad ;
schar history ;
integer errcount ;
ASCIIcode xord[128] ;
char xchr[128] ;
lextype lexclass[128] ;
idtype idclass[128] ;
integer charwidth[128] ;
/*
* Changed by Vince from stringwidth -> bibstringwidth
* to avoid a name clash.
*/
integer bibstringwidth ;
char nameoffile[1025], realnameoffile[1025] ;
short namelength ;
short nameptr ;
buftype buffer ;
bufpointer last ;
buftype svbuffer ;
bufpointer svptr1 ;
bufpointer svptr2 ;
integer tmpptr, tmpendptr ;
ASCIIcode *strpool;
poolpointer strstart[maxstrings + 1] ;
poolpointer poolptr ;
strnumber strptr ;
strnumber strnum ;
poolpointer pptr1, pptr2 ;
hashpointer *hashnext;
strnumber *hashtext;
strilk *hashilk;
integer *ilkinfo;
short hashused ;
boolean hashfound ;
hashloc dummyloc ;
strnumber sauxextension ;
strnumber slogextension ;
strnumber sbblextension ;
strnumber sbstextension ;
strnumber sbibextension ;
strnumber sbstarea ;
strnumber sbibarea ;
hashloc predefloc ;
integer commandnum ;
bufpointer bufptr1 ;
bufpointer bufptr2 ;
schar scanresult ;
integer tokenvalue ;
short auxnamelength ;
alphafile auxfile[auxstacksize + 1] ;
strnumber auxlist[auxstacksize + 1] ;
integer auxlnstack[auxstacksize + 1] ;
auxnumber auxptr ;
strnumber toplevstr ;
alphafile logfile ;
alphafile bblfile ;
strnumber biblist[maxbibfiles + 1] ;
bibnumber bibptr ;
bibnumber numbibfiles ;
boolean bibseen ;
alphafile bibfile[maxbibfiles + 1] ;
boolean bstseen ;
strnumber bststr ;
alphafile bstfile ;
strnumber *citelist;
citenumber citeptr ;
citenumber entryciteptr ;
citenumber numcites ;
citenumber oldnumcites ;
boolean citationseen ;
hashloc citeloc ;
hashloc lcciteloc ;
hashloc lcxciteloc ;
boolean citefound ;
boolean allentries ;
citenumber allmarker ;
integer bbllinenum ;
integer bstlinenum ;
hashloc fnloc ;
hashloc wizloc ;
hashloc literalloc ;
hashloc macronameloc ;
hashloc macrodefloc ;
fnclass *fntype;
wizfnloc wizdefptr ;
wizfnloc wizfnptr ;
hashptr2 *wizfunctions;
intentloc intentptr ;
integer *entryints;
intentloc numentints ;
strentloc strentptr ;
ASCIIcode (*entrystrs)[entstrsize + 1] ;
strentloc numentstrs ;
schar strglbptr ;
strnumber glbstrptr[10] ;
ASCIIcode (*globalstrs)[globstrsize + 1] ;
integer glbstrend[10] ;
schar numglbstrs ;
fieldloc fieldptr ;
fieldloc fieldparentptr, fieldendptr ;
citenumber citeparentptr, citexptr ;
strnumber *fieldinfo;
fieldloc numfields ;
fieldloc numpredefinedfields ;
fieldloc crossrefnum ;
boolean nofields ;
boolean entryseen ;
boolean readseen ;
boolean readperformed ;
boolean readingcompleted ;
boolean readcompleted ;
integer implfnnum ;
integer biblinenum ;
hashloc entrytypeloc ;
hashptr2 typelist[maxcites + 1] ;
boolean typeexists ;
boolean entryexists[maxcites + 1] ;
boolean storeentry ;
hashloc fieldnameloc ;
hashloc fieldvalloc ;
boolean storefield ;
boolean storetoken ;
ASCIIcode rightouterdelim ;
ASCIIcode rightstrdelim ;
boolean atbibcommand ;
hashloc curmacroloc ;
strnumber *citeinfo;
boolean citehashfound ;
bibnumber preambleptr ;
bibnumber numpreamblestrings ;
integer bibbracelevel ;
integer litstack[litstksize + 1] ;
stktype litstktype[litstksize + 1] ;
litstkloc litstkptr ;
strnumber cmdstrptr ;
integer entchrptr ;
integer globchrptr ;
buftype exbuf ;
bufpointer exbufptr ;
bufpointer exbuflength ;
buftype outbuf ;
bufpointer outbufptr ;
bufpointer outbuflength ;
boolean messwithentries ;
citenumber sortciteptr ;
strentloc sortkeynum ;
integer bracelevel ;
hashloc bequals ;
hashloc bgreaterthan ;
hashloc blessthan ;
hashloc bplus ;
hashloc bminus ;
hashloc bconcatenate ;
hashloc bgets ;
hashloc baddperiod ;
hashloc bcalltype ;
hashloc bchangecase ;
hashloc bchrtoint ;
hashloc bcite ;
hashloc bduplicate ;
hashloc bempty ;
hashloc bformatname ;
hashloc bif ;
hashloc binttochr ;
hashloc binttostr ;
hashloc bmissing ;
hashloc bnewline ;
hashloc bnumnames ;
hashloc bpop ;
hashloc bpreamble ;
hashloc bpurify ;
hashloc bquote ;
hashloc bskip ;
hashloc bstack ;
hashloc bsubstring ;
hashloc bswap ;
hashloc btextlength ;
hashloc btextprefix ;
hashloc btopstack ;
hashloc btype ;
hashloc bwarning ;
hashloc bwhile ;
hashloc bwidth ;
hashloc bwrite ;
hashloc bdefault ;
#ifdef STAT
hashloc bltinloc[numbltinfns + 1] ;
integer executioncount[numbltinfns + 1] ;
integer totalexcount ;
bltinrange bltinptr ;
#endif /* STAT */
strnumber snull ;
strnumber sdefault ;
strnumber st ;
strnumber sl ;
strnumber su ;
strnumber spreamble[maxbibfiles + 1] ;
integer poplit1, poplit2, poplit3 ;
stktype poptyp1, poptyp2, poptyp3 ;
poolpointer spptr ;
poolpointer spxptr1, spxptr2 ;
poolpointer spend ;
poolpointer splength, sp2length ;
integer spbracelevel ;
bufpointer exbufxptr, exbufyptr ;
hashloc controlseqloc ;
boolean precedingwhite ;
boolean andfound ;
integer numnames ;
bufpointer namebfptr ;
bufpointer namebfxptr, namebfyptr ;
integer nmbracelevel ;
bufpointer *nametok;
ASCIIcode *namesepchar;
bufpointer numtokens ;
boolean tokenstarting ;
boolean alphafound ;
boolean doubleletter, endofgroup, tobewritten ;
bufpointer firststart ;
bufpointer firstend ;
bufpointer lastend ;
bufpointer vonstart ;
bufpointer vonend ;
bufpointer jrend ;
bufpointer curtoken, lasttoken ;
boolean usedefault ;
bufpointer numcommas ;
bufpointer comma1, comma2 ;
bufpointer numtextchars ;
schar conversiontype ;
boolean prevcolon ;
#include "coerce.h"
void bstentrycommand (void) {
/* 10 */ if ( ( entryseen ) )
{
{
(void) ReverseFPuts( logfile , "Illegal, another entry command" ) ;
(void) FPrintFStdErr( "Illegal, another entry command" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
entryseen = true ;
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "entry" ) ;
(void) FPrintFStdErr( "entry" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
{
if ( ( buffer [ bufptr2 ] != 123 ) )
{
bstleftbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "entry" ) ;
(void) FPrintFStdErr( "entry" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "entry" ) ;
(void) FPrintFStdErr( "entry" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
while ( ( buffer [ bufptr2 ] != 125 ) ) {
{
scanidentifier ( 125 , 37 , 37 ) ;
if ( ( ( scanresult == 3 ) || ( scanresult == 1 ) ) )
;
else {
bstidprint () ;
{
{
(void) ReverseFPuts( logfile , "entry" ) ;
(void) FPrintFStdErr( "entry" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
;
#ifdef TRACE
{
outtoken ( logfile ) ;
}
{
(void) FPrintF( logfile , "%s\r", " is a field" ) ;
}
#endif /* TRACE */
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
fnloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 11 ,
true ) ;
{
if ( ( hashfound ) )
{
alreadyseenfunctionp ( fnloc ) ;
goto lab10 ;
}
}
fntype [ fnloc ] = 4 ;
ilkinfo [ fnloc ] = numfields ;
incr ( numfields ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "entry" ) ;
(void) FPrintFStdErr( "entry" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
}
incr ( bufptr2 ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "entry" ) ;
(void) FPrintFStdErr( "entry" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
if ( ( numfields == numpredefinedfields ) )
{
{
(void) ReverseFPuts( logfile , "Warning--I didn't find any fields" ) ;
(void) FPrintFStdErr( "Warning--I didn't find any fields" ) ;
}
bstwarnprint () ;
}
{
{
if ( ( buffer [ bufptr2 ] != 123 ) )
{
bstleftbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "entry" ) ;
(void) FPrintFStdErr( "entry" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "entry" ) ;
(void) FPrintFStdErr( "entry" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
while ( ( buffer [ bufptr2 ] != 125 ) ) {
{
scanidentifier ( 125 , 37 , 37 ) ;
if ( ( ( scanresult == 3 ) || ( scanresult == 1 ) ) )
;
else {
bstidprint () ;
{
{
(void) ReverseFPuts( logfile , "entry" ) ;
(void) FPrintFStdErr( "entry" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
;
#ifdef TRACE
{
outtoken ( logfile ) ;
}
{
(void) FPrintF( logfile , "%s\r", " is an integer entry-variable" ) ;
}
#endif /* TRACE */
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
fnloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 11 ,
true ) ;
{
if ( ( hashfound ) )
{
alreadyseenfunctionp ( fnloc ) ;
goto lab10 ;
}
}
fntype [ fnloc ] = 5 ;
ilkinfo [ fnloc ] = numentints ;
incr ( numentints ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "entry" ) ;
(void) FPrintFStdErr( "entry" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
}
incr ( bufptr2 ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "entry" ) ;
(void) FPrintFStdErr( "entry" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
{
if ( ( buffer [ bufptr2 ] != 123 ) )
{
bstleftbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "entry" ) ;
(void) FPrintFStdErr( "entry" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "entry" ) ;
(void) FPrintFStdErr( "entry" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
while ( ( buffer [ bufptr2 ] != 125 ) ) {
{
scanidentifier ( 125 , 37 , 37 ) ;
if ( ( ( scanresult == 3 ) || ( scanresult == 1 ) ) )
;
else {
bstidprint () ;
{
{
(void) ReverseFPuts( logfile , "entry" ) ;
(void) FPrintFStdErr( "entry" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
;
#ifdef TRACE
{
outtoken ( logfile ) ;
}
{
(void) FPrintF( logfile , "%s\r", " is a string entry-variable" ) ;
}
#endif /* TRACE */
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
fnloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 11 ,
true ) ;
{
if ( ( hashfound ) )
{
alreadyseenfunctionp ( fnloc ) ;
goto lab10 ;
}
}
fntype [ fnloc ] = 6 ;
ilkinfo [ fnloc ] = numentstrs ;
incr ( numentstrs ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "entry" ) ;
(void) FPrintFStdErr( "entry" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
}
incr ( bufptr2 ) ;
}
lab10: ;
}
boolean badargumenttoken () {
/* 10 */ register boolean Result; Result = true
;
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
fnloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 11 , false )
;
if ( ( ! hashfound ) )
{
printatoken () ;
{
{
(void) ReverseFPuts( logfile , " is an unknown function" ) ;
(void) FPrintFStdErr( " is an unknown function" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
else if ( ( ( fntype [ fnloc ] != 0 ) && ( fntype [ fnloc ] != 1 ) ) )
{
printatoken () ;
{
(void) ReverseFPuts( logfile , " has bad function type " ) ;
(void) FPrintFStdErr( " has bad function type " ) ;
}
printfnclass ( fnloc ) ;
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
Result = false ;
lab10: ;
return(Result) ;
}
void bstexecutecommand (void) {
/* 10 */ if ( ( ! readseen ) )
{
{
(void) ReverseFPuts( logfile , "Illegal, execute command before read command" ) ;
(void) FPrintFStdErr( "Illegal, execute command before read command" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "execute" ) ;
(void) FPrintFStdErr( "execute" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
if ( ( buffer [ bufptr2 ] != 123 ) )
{
bstleftbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "execute" ) ;
(void) FPrintFStdErr( "execute" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "execute" ) ;
(void) FPrintFStdErr( "execute" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
scanidentifier ( 125 , 37 , 37 ) ;
if ( ( ( scanresult == 3 ) || ( scanresult == 1 ) ) )
;
else {
bstidprint () ;
{
{
(void) ReverseFPuts( logfile , "execute" ) ;
(void) FPrintFStdErr( "execute" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
;
#ifdef TRACE
{
outtoken ( logfile ) ;
}
{
(void) FPrintF( logfile , "%s\r", " is a to be executed function" ) ;
}
#endif /* TRACE */
if ( ( badargumenttoken () ) )
goto lab10 ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "execute" ) ;
(void) FPrintFStdErr( "execute" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
if ( ( buffer [ bufptr2 ] != 125 ) )
{
bstrightbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "execute" ) ;
(void) FPrintFStdErr( "execute" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
{
initcommandexecution () ;
messwithentries = false ;
executefn ( fnloc ) ;
checkcommandexecutio () ;
}
lab10: ;
}
void bstfunctioncommand (void) {
/* 10 */ {
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "function" ) ;
(void) FPrintFStdErr( "function" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
{
if ( ( buffer [ bufptr2 ] != 123 ) )
{
bstleftbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "function" ) ;
(void) FPrintFStdErr( "function" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "function" ) ;
(void) FPrintFStdErr( "function" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
scanidentifier ( 125 , 37 , 37 ) ;
if ( ( ( scanresult == 3 ) || ( scanresult == 1 ) ) )
;
else {
bstidprint () ;
{
{
(void) ReverseFPuts( logfile , "function" ) ;
(void) FPrintFStdErr( "function" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
;
#ifdef TRACE
{
outtoken ( logfile ) ;
}
{
(void) FPrintF( logfile , "%s\r", " is a wizard-defined function" ) ;
}
#endif /* TRACE */
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
wizloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 11 ,
true ) ;
{
if ( ( hashfound ) )
{
alreadyseenfunctionp ( wizloc ) ;
goto lab10 ;
}
}
fntype [ wizloc ] = 1 ;
if ( ( hashtext [ wizloc ] == sdefault ) )
bdefault = wizloc ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "function" ) ;
(void) FPrintFStdErr( "function" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
if ( ( buffer [ bufptr2 ] != 125 ) )
{
bstrightbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "function" ) ;
(void) FPrintFStdErr( "function" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "function" ) ;
(void) FPrintFStdErr( "function" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
if ( ( buffer [ bufptr2 ] != 123 ) )
{
bstleftbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "function" ) ;
(void) FPrintFStdErr( "function" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
scanfndef ( wizloc ) ;
lab10: ;
}
void bstintegerscommand (void) {
/* 10 */ {
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "integers" ) ;
(void) FPrintFStdErr( "integers" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
if ( ( buffer [ bufptr2 ] != 123 ) )
{
bstleftbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "integers" ) ;
(void) FPrintFStdErr( "integers" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "integers" ) ;
(void) FPrintFStdErr( "integers" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
while ( ( buffer [ bufptr2 ] != 125 ) ) {
{
scanidentifier ( 125 , 37 , 37 ) ;
if ( ( ( scanresult == 3 ) || ( scanresult == 1 ) ) )
;
else {
bstidprint () ;
{
{
(void) ReverseFPuts( logfile , "integers" ) ;
(void) FPrintFStdErr( "integers" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
;
#ifdef TRACE
{
outtoken ( logfile ) ;
}
{
(void) FPrintF( logfile , "%s\r", " is an integer global-variable" ) ;
}
#endif /* TRACE */
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
fnloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 11 , true
) ;
{
if ( ( hashfound ) )
{
alreadyseenfunctionp ( fnloc ) ;
goto lab10 ;
}
}
fntype [ fnloc ] = 7 ;
ilkinfo [ fnloc ] = 0 ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "integers" ) ;
(void) FPrintFStdErr( "integers" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
}
incr ( bufptr2 ) ;
lab10: ;
}
void bstiteratecommand (void) {
/* 10 */ if ( ( ! readseen ) )
{
{
(void) ReverseFPuts( logfile , "Illegal, iterate command before read command" ) ;
(void) FPrintFStdErr( "Illegal, iterate command before read command" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "iterate" ) ;
(void) FPrintFStdErr( "iterate" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
if ( ( buffer [ bufptr2 ] != 123 ) )
{
bstleftbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "iterate" ) ;
(void) FPrintFStdErr( "iterate" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "iterate" ) ;
(void) FPrintFStdErr( "iterate" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
scanidentifier ( 125 , 37 , 37 ) ;
if ( ( ( scanresult == 3 ) || ( scanresult == 1 ) ) )
;
else {
bstidprint () ;
{
{
(void) ReverseFPuts( logfile , "iterate" ) ;
(void) FPrintFStdErr( "iterate" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
;
#ifdef TRACE
{
outtoken ( logfile ) ;
}
{
(void) FPrintF( logfile , "%s\r", " is a to be iterated function" ) ;
}
#endif /* TRACE */
if ( ( badargumenttoken () ) )
goto lab10 ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "iterate" ) ;
(void) FPrintFStdErr( "iterate" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
if ( ( buffer [ bufptr2 ] != 125 ) )
{
bstrightbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "iterate" ) ;
(void) FPrintFStdErr( "iterate" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
{
initcommandexecution () ;
messwithentries = true ;
sortciteptr = 0 ;
while ( ( sortciteptr < numcites ) ) {
citeptr = citeinfo [ sortciteptr ] ;
;
#ifdef TRACE
{
outpoolstr ( logfile , hashtext [ fnloc ] ) ;
}
{
(void) ReverseFPuts( logfile , " to be iterated on " ) ;
}
{
outpoolstr ( logfile , citelist [ citeptr ] ) ;
}
{
(void) FPutC('\r', logfile );
}
#endif /* TRACE */
executefn ( fnloc ) ;
checkcommandexecutio () ;
incr ( sortciteptr ) ;
}
}
lab10: ;
}
void bstmacrocommand (void) {
/* 10 */ if ( ( readseen ) )
{
{
(void) ReverseFPuts( logfile , "Illegal, macro command after read command" ) ;
(void) FPrintFStdErr( "Illegal, macro command after read command" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "macro" ) ;
(void) FPrintFStdErr( "macro" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
{
if ( ( buffer [ bufptr2 ] != 123 ) )
{
bstleftbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "macro" ) ;
(void) FPrintFStdErr( "macro" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "macro" ) ;
(void) FPrintFStdErr( "macro" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
scanidentifier ( 125 , 37 , 37 ) ;
if ( ( ( scanresult == 3 ) || ( scanresult == 1 ) ) )
;
else {
bstidprint () ;
{
{
(void) ReverseFPuts( logfile , "macro" ) ;
(void) FPrintFStdErr( "macro" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
;
#ifdef TRACE
{
outtoken ( logfile ) ;
}
{
(void) FPrintF( logfile , "%s\r", " is a macro" ) ;
}
#endif /* TRACE */
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
macronameloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 13
, true ) ;
if ( ( hashfound ) )
{
printatoken () ;
{
{
(void) ReverseFPuts( logfile , " is already defined as a macro" ) ;
(void) FPrintFStdErr( " is already defined as a macro" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
ilkinfo [ macronameloc ] = hashtext [ macronameloc ] ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "macro" ) ;
(void) FPrintFStdErr( "macro" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
if ( ( buffer [ bufptr2 ] != 125 ) )
{
bstrightbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "macro" ) ;
(void) FPrintFStdErr( "macro" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "macro" ) ;
(void) FPrintFStdErr( "macro" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
{
if ( ( buffer [ bufptr2 ] != 123 ) )
{
bstleftbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "macro" ) ;
(void) FPrintFStdErr( "macro" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "macro" ) ;
(void) FPrintFStdErr( "macro" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
if ( ( buffer [ bufptr2 ] != 34 ) )
{
{
(void) FPrintF( logfile , "%s%c%s", "A macro definition must be " , xchr [ 34 ] , "-delimited" ) ;
(void) FPrintFStdErr( "%s%c%s", "A macro definition must be " , xchr [ 34 ] , "-delimited" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
{
incr ( bufptr2 ) ;
if ( ( ! scan1 ( 34 ) ) )
{
{
(void) FPrintF( logfile , "%s%c%s", "There's no `" , xchr [ 34 ] , "' to end macro definition" ) ;
(void) FPrintFStdErr( "%s%c%s", "There's no `" , xchr [ 34 ] , "' to end macro definition" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
;
#ifdef TRACE
{
(void) FPutC( '"' , logfile );
}
{
outtoken ( logfile ) ;
}
{
(void) FPutC( '"' , logfile );
}
{
(void) FPrintF( logfile , "%s\r", " is a macro string" ) ;
}
#endif /* TRACE */
macrodefloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 0 ,
true ) ;
fntype [ macrodefloc ] = 3 ;
ilkinfo [ macronameloc ] = hashtext [ macrodefloc ] ;
incr ( bufptr2 ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "macro" ) ;
(void) FPrintFStdErr( "macro" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
if ( ( buffer [ bufptr2 ] != 125 ) )
{
bstrightbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "macro" ) ;
(void) FPrintFStdErr( "macro" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
}
lab10: ;
}
void getbibcommandorentry (void) {
/* 22 26 15 10 */ atbibcommand = false ;
while ( ( ! scan1 ( 64 ) ) ) {
if ( ( ! inputln ( bibfile [ bibptr ] ) ) )
goto lab10 ;
incr ( biblinenum ) ;
bufptr2 = 0 ;
}
{
if ( ( buffer [ bufptr2 ] != 64 ) )
{
{
(void) FPrintF( logfile , "%s%c%s", "An \"" , xchr [ 64 ] , "\" disappeared" ) ;
(void) FPrintFStdErr( "%s%c%s", "An \"" , xchr [ 64 ] , "\" disappeared" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
incr ( bufptr2 ) ;
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
scanidentifier ( 123 , 40 , 40 ) ;
{
if ( ( ( scanresult == 3 ) || ( scanresult == 1 ) ) )
;
else {
bibidprint () ;
{
{
(void) ReverseFPuts( logfile , "an entry type" ) ;
(void) FPrintFStdErr( "an entry type" ) ;
}
biberrprint () ;
goto lab10 ;
}
}
}
;
#ifdef TRACE
{
outtoken ( logfile ) ;
}
{
(void) FPrintF( logfile , "%s\r", " is an entry type or a database-file command" ) ;
}
#endif /* TRACE */
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
commandnum = ilkinfo [ strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1
) , 12 , false ) ] ;
if ( ( hashfound ) )
{
atbibcommand = true ;
switch ( ( commandnum ) )
{case 0 :
{
goto lab10 ;
}
break ;
case 1 :
{
if ( ( preambleptr == maxbibfiles ) )
{
{
(void) FPrintF( logfile , "%s%ld%s", "You've exceeded " , (long)maxbibfiles , " preamble commands" ) ;
(void) FPrintFStdErr( "%s%ld%s", "You've exceeded " , (long)maxbibfiles , " preamble commands" ) ;
}
biberrprint () ;
goto lab10 ;
}
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
if ( ( buffer [ bufptr2 ] == 123 ) )
rightouterdelim = 125 ;
else if ( ( buffer [ bufptr2 ] == 40 ) )
rightouterdelim = 41 ;
else {
biboneoftwoprint ( 123 , 40 ) ;
goto lab10 ;
}
incr ( bufptr2 ) ;
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
storefield = true ;
if ( ( ! scanandstorethefield () ) )
goto lab10 ;
if ( ( buffer [ bufptr2 ] != rightouterdelim ) )
{
{
(void) FPrintF( logfile , "%s%c%s", "Missing \"" , xchr [ rightouterdelim ] , "\" in preamble command" ) ;
(void) FPrintFStdErr( "%s%c%s", "Missing \"" , xchr [ rightouterdelim ] , "\" in preamble command" ) ;
}
biberrprint () ;
goto lab10 ;
}
incr ( bufptr2 ) ;
goto lab10 ;
}
break ;
case 2 :
{
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
{
if ( ( buffer [ bufptr2 ] == 123 ) )
rightouterdelim = 125 ;
else if ( ( buffer [ bufptr2 ] == 40 ) )
rightouterdelim = 41 ;
else {
biboneoftwoprint ( 123 , 40 ) ;
goto lab10 ;
}
incr ( bufptr2 ) ;
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
scanidentifier ( 61 , 61 , 61 ) ;
{
if ( ( ( scanresult == 3 ) || ( scanresult == 1 ) ) )
;
else {
bibidprint () ;
{
{
(void) ReverseFPuts( logfile , "a string name" ) ;
(void) FPrintFStdErr( "a string name" ) ;
}
biberrprint () ;
goto lab10 ;
}
}
}
{
;
#ifdef TRACE
{
outtoken ( logfile ) ;
}
{
(void) FPrintF( logfile , "%s\r", " is a database-defined macro" ) ;
}
#endif /* TRACE */
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
curmacroloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1
) , 13 , true ) ;
ilkinfo [ curmacroloc ] = hashtext [ curmacroloc ] ;
}
}
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
{
if ( ( buffer [ bufptr2 ] != 61 ) )
{
bibequalssignprint () ;
goto lab10 ;
}
incr ( bufptr2 ) ;
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
storefield = true ;
if ( ( ! scanandstorethefield () ) )
goto lab10 ;
if ( ( buffer [ bufptr2 ] != rightouterdelim ) )
{
{
(void) FPrintF( logfile , "%s%c%s", "Missing \"" , xchr [ rightouterdelim ] , "\" in string command" ) ;
(void) FPrintFStdErr( "%s%c%s", "Missing \"" , xchr [ rightouterdelim ] , "\" in string command" ) ;
}
biberrprint () ;
goto lab10 ;
}
incr ( bufptr2 ) ;
}
goto lab10 ;
}
break ;
default:
bibcmdconfusion () ;
break ;
}
}
else {
entrytypeloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 11
, false ) ;
if ( ( ( ! hashfound ) || ( fntype [ entrytypeloc ] != 1 ) ) )
typeexists = false ;
else typeexists = true ;
}
}
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
{
if ( ( buffer [ bufptr2 ] == 123 ) )
rightouterdelim = 125 ;
else if ( ( buffer [ bufptr2 ] == 40 ) )
rightouterdelim = 41 ;
else {
biboneoftwoprint ( 123 , 40 ) ;
goto lab10 ;
}
incr ( bufptr2 ) ;
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
if ( ( rightouterdelim == 41 ) )
{
if ( ( scan1white ( 44 ) ) )
;
}
else if ( ( scan2white ( 44 , 125 ) ) )
;
{
;
#ifdef TRACE
{
outtoken ( logfile ) ;
}
{
(void) FPrintF( logfile , "%s\r", " is a database key" ) ;
}
#endif /* TRACE */
tmpptr = bufptr1 ;
while ( ( tmpptr < bufptr2 ) ) {
exbuf [ tmpptr ] = buffer [ tmpptr ] ;
incr ( tmpptr ) ;
}
lowercase ( exbuf , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
if ( ( allentries ) )
lcciteloc = strlookup ( exbuf , bufptr1 , ( bufptr2 - bufptr1 ) , 10 ,
true ) ;
else lcciteloc = strlookup ( exbuf , bufptr1 , ( bufptr2 - bufptr1 ) ,
10 , false ) ;
if ( ( hashfound ) )
{
entryciteptr = ilkinfo [ ilkinfo [ lcciteloc ] ] ;
{
if ( ( ( ! allentries ) || ( entryciteptr < allmarker ) || (
entryciteptr >= oldnumcites ) ) )
{
if ( ( typelist [ entryciteptr ] == 0 ) )
{
{
if ( ( ( ! allentries ) && ( entryciteptr >= oldnumcites ) ) )
{
citeloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1
) , 9 , true ) ;
if ( ( ! hashfound ) )
{
ilkinfo [ lcciteloc ] = citeloc ;
ilkinfo [ citeloc ] = entryciteptr ;
citelist [ entryciteptr ] = hashtext [ citeloc ] ;
hashfound = true ;
}
}
}
goto lab26 ;
}
}
else if ( ( ! entryexists [ entryciteptr ] ) )
{
{
exbufptr = 0 ;
tmpptr = strstart [ citeinfo [ entryciteptr ] ] ;
tmpendptr = strstart [ citeinfo [ entryciteptr ] + 1 ] ;
while ( ( tmpptr < tmpendptr ) ) {
exbuf [ exbufptr ] = strpool [ tmpptr ] ;
incr ( exbufptr ) ;
incr ( tmpptr ) ;
}
lowercase ( exbuf , 0 , ( strstart [ citeinfo [ entryciteptr ] +
1 ] - strstart [ citeinfo [ entryciteptr ] ] ) ) ;
lcxciteloc = strlookup ( exbuf , 0 , ( strstart [ citeinfo [
entryciteptr ] + 1 ] - strstart [ citeinfo [ entryciteptr ] ] )
, 10 , false ) ;
if ( ( ! hashfound ) )
citekeydisappearedco () ;
}
if ( ( lcxciteloc == lcciteloc ) )
goto lab26 ;
}
if ( ( typelist [ entryciteptr ] == 0 ) )
{
{
(void) ReverseFPuts( logfile , "The cite list is messed up" ) ;
(void) FPrintFStdErr( "The cite list is messed up" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
{
{
(void) ReverseFPuts( logfile , "Repeated entry" ) ;
(void) FPrintFStdErr( "Repeated entry" ) ;
}
biberrprint () ;
goto lab10 ;
}
lab26: ;
}
}
storeentry = true ;
if ( ( allentries ) )
{
if ( ( hashfound ) )
{
if ( ( entryciteptr < allmarker ) )
goto lab22 ;
else {
entryexists [ entryciteptr ] = true ;
citeloc = ilkinfo [ lcciteloc ] ;
}
}
else {
citeloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 9 ,
true ) ;
if ( ( hashfound ) )
hashciteconfusion () ;
}
entryciteptr = citeptr ;
adddatabasecite ( citeptr ) ;
lab22: ;
}
else if ( ( ! hashfound ) )
storeentry = false ;
if ( ( storeentry ) )
{
if ( ( typeexists ) )
typelist [ entryciteptr ] = entrytypeloc ;
else {
typelist [ entryciteptr ] = 5001 ;
{
(void) ReverseFPuts( logfile , "Warning--entry type for \"" ) ;
(void) FPrintFStdErr( "Warning--entry type for \"" ) ;
}
printatoken () ;
{
{
(void) FPrintF( logfile , "%s\r", "\" isn't style-file defined" ) ;
(void) FPrintFStdErr( "%s\r", "\" isn't style-file defined" ) ;
}
bibwarnprint () ;
}
}
}
}
}
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
{
while ( ( buffer [ bufptr2 ] != rightouterdelim ) ) {
if ( ( buffer [ bufptr2 ] != 44 ) )
{
biboneoftwoprint ( 44 , rightouterdelim ) ;
goto lab10 ;
}
incr ( bufptr2 ) ;
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
if ( ( buffer [ bufptr2 ] == rightouterdelim ) )
goto lab15 ;
{
scanidentifier ( 61 , 61 , 61 ) ;
{
if ( ( ( scanresult == 3 ) || ( scanresult == 1 ) ) )
;
else {
bibidprint () ;
{
{
(void) ReverseFPuts( logfile , "a field name" ) ;
(void) FPrintFStdErr( "a field name" ) ;
}
biberrprint () ;
goto lab10 ;
}
}
}
;
#ifdef TRACE
{
outtoken ( logfile ) ;
}
{
(void) FPrintF( logfile , "%s\r", " is a field name" ) ;
}
#endif /* TRACE */
storefield = false ;
if ( ( storeentry ) )
{
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
fieldnameloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 )
, 11 , false ) ;
if ( ( hashfound ) )
if ( ( fntype [ fieldnameloc ] == 4 ) )
storefield = true ;
}
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
if ( ( buffer [ bufptr2 ] != 61 ) )
{
bibequalssignprint () ;
goto lab10 ;
}
incr ( bufptr2 ) ;
}
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
if ( ( ! scanandstorethefield () ) )
goto lab10 ;
}
lab15: incr ( bufptr2 ) ;
}
lab10: ;
}
void bstreadcommand (void) {
/* 10 */ if ( ( readseen ) )
{
{
(void) ReverseFPuts( logfile , "Illegal, another read command" ) ;
(void) FPrintFStdErr( "Illegal, another read command" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
readseen = true ;
if ( ( ! entryseen ) )
{
{
(void) ReverseFPuts( logfile , "Illegal, read command before entry command" ) ;
(void) FPrintFStdErr( "Illegal, read command before entry command" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
svptr1 = bufptr2 ;
svptr2 = last ;
tmpptr = svptr1 ;
while ( ( tmpptr < svptr2 ) ) {
svbuffer [ tmpptr ] = buffer [ tmpptr ] ;
incr ( tmpptr ) ;
}
{
{
{
checkfieldoverflow ( numfields * numcites ) ;
fieldptr = 0 ;
while ( ( fieldptr < maxfields ) ) {
fieldinfo [ fieldptr ] = 0 ;
incr ( fieldptr ) ;
}
}
{
citeptr = 0 ;
while ( ( citeptr < maxcites ) ) {
typelist [ citeptr ] = 0 ;
citeinfo [ citeptr ] = 0 ;
incr ( citeptr ) ;
}
oldnumcites = numcites ;
if ( ( allentries ) )
{
citeptr = allmarker ;
while ( ( citeptr < oldnumcites ) ) {
citeinfo [ citeptr ] = citelist [ citeptr ] ;
entryexists [ citeptr ] = false ;
incr ( citeptr ) ;
}
citeptr = allmarker ;
}
else {
citeptr = numcites ;
allmarker = 0 ;
}
}
}
readperformed = true ;
bibptr = 0 ;
while ( ( bibptr < numbibfiles ) ) {
{
(void) FPrintF( logfile , "%s%ld%s", "Database file #" , (long)bibptr + 1 , ": " ) ;
(void) FPrintFStdErr( "%s%ld%s", "Database file #" , (long)bibptr + 1 , ": " ) ;
}
printbibname () ;
biblinenum = 0 ;
bufptr2 = last ;
while ( ( ! eof ( bibfile [ bibptr ] ) ) ) getbibcommandorentry () ;
aclose ( bibfile [ bibptr ] ) ;
incr ( bibptr ) ;
}
readingcompleted = true ;
;
#ifdef TRACE
{
(void) FPrintF( logfile , "%s\r", "Finished reading the database file(s)" ) ;
}
#endif /* TRACE */
{
numcites = citeptr ;
numpreamblestrings = preambleptr ;
{
citeptr = 0 ;
while ( ( citeptr < numcites ) ) {
fieldptr = citeptr * numfields + crossrefnum ;
if ( ( fieldinfo [ fieldptr ] != 0 ) )
if ( ( findcitelocsforthisc ( fieldinfo [ fieldptr ] ) ) )
{
citeloc = ilkinfo [ lcciteloc ] ;
fieldinfo [ fieldptr ] = hashtext [ citeloc ] ;
citeparentptr = ilkinfo [ citeloc ] ;
fieldptr = citeptr * numfields + numpredefinedfields ;
fieldendptr = fieldptr - numpredefinedfields + numfields ;
fieldparentptr = citeparentptr * numfields + numpredefinedfields ;
while ( ( fieldptr < fieldendptr ) ) {
if ( ( fieldinfo [ fieldptr ] == 0 ) )
fieldinfo [ fieldptr ] = fieldinfo [ fieldparentptr ] ;
incr ( fieldptr ) ;
incr ( fieldparentptr ) ;
}
}
incr ( citeptr ) ;
}
}
{
citeptr = 0 ;
while ( ( citeptr < numcites ) ) {
fieldptr = citeptr * numfields + crossrefnum ;
if ( ( fieldinfo [ fieldptr ] != 0 ) )
if ( ( ! findcitelocsforthisc ( fieldinfo [ fieldptr ] ) ) )
{
if ( ( citehashfound ) )
hashciteconfusion () ;
nonexistentcrossrefe () ;
fieldinfo [ fieldptr ] = 0 ;
}
else {
if ( ( citeloc != ilkinfo [ lcciteloc ] ) )
hashciteconfusion () ;
citeparentptr = ilkinfo [ citeloc ] ;
if ( ( typelist [ citeparentptr ] == 0 ) )
{
nonexistentcrossrefe () ;
fieldinfo [ fieldptr ] = 0 ;
}
else {
fieldparentptr = citeparentptr * numfields + crossrefnum ;
if ( ( fieldinfo [ fieldparentptr ] != 0 ) )
{
{
(void) ReverseFPuts( logfile , "Warning--you've nested cross references" ) ;
(void) FPrintFStdErr( "Warning--you've nested cross references" )
;
}
badcrossreferencepri ( citelist [ citeparentptr ] ) ;
{
(void) FPrintF( logfile , "%s%ld\r", "\", (long)which also refers to something" ) ;
(void) FPrintFStdErr( "%s%ld\r", "\", (long)which also refers to something" ) ;
}
markwarning () ;
}
if ( ( ( ! allentries ) && ( citeparentptr >= oldnumcites ) && (
citeinfo [ citeparentptr ] < mincrossrefs ) ) )
fieldinfo [ fieldptr ] = 0 ;
}
}
incr ( citeptr ) ;
}
}
{
citeptr = 0 ;
while ( ( citeptr < numcites ) ) {
if ( ( typelist [ citeptr ] == 0 ) )
printmissingentry ( citelist [ citeptr ] ) ;
else if ( ( ( allentries ) || ( citeptr < oldnumcites ) || (
citeinfo [ citeptr ] >= mincrossrefs ) ) )
{
if ( ( citeptr > citexptr ) )
{
citelist [ citexptr ] = citelist [ citeptr ] ;
typelist [ citexptr ] = typelist [ citeptr ] ;
if ( ( ! findcitelocsforthisc ( citelist [ citeptr ] ) ) )
citekeydisappearedco () ;
if ( ( ( ! citehashfound ) || ( citeloc != ilkinfo [ lcciteloc ]
) ) )
hashciteconfusion () ;
ilkinfo [ citeloc ] = citexptr ;
fieldptr = citexptr * numfields ;
fieldendptr = fieldptr + numfields ;
tmpptr = citeptr * numfields ;
while ( ( fieldptr < fieldendptr ) ) {
fieldinfo [ fieldptr ] = fieldinfo [ tmpptr ] ;
incr ( fieldptr ) ;
incr ( tmpptr ) ;
}
}
incr ( citexptr ) ;
}
incr ( citeptr ) ;
}
numcites = citexptr ;
if ( ( allentries ) )
{
citeptr = allmarker ;
while ( ( citeptr < oldnumcites ) ) {
if ( ( ! entryexists [ citeptr ] ) )
printmissingentry ( citeinfo [ citeptr ] ) ;
incr ( citeptr ) ;
}
}
}
{
if ( ( numentints * numcites > maxentints ) )
{
{
(void) FPrintF( logfile , "%ld%s", (long)numentints * numcites , ": " ) ;
(void) FPrintFStdErr( "%ld%s", (long)numentints * numcites , ": " ) ;
}
{
printoverflow () ;
{
(void) FPrintF( logfile , "%s%ld\r", "total number of integer entry-variables " , (long)maxentints ) ;
(void) FPrintFStdErr( "%s%ld\r", "total number of integer entry-variables " , (long)maxentints ) ;
}
longjmp(jmp9998,1) ;
}
}
intentptr = 0 ;
while ( ( intentptr < numentints * numcites ) ) {
entryints [ intentptr ] = 0 ;
incr ( intentptr ) ;
}
}
{
if ( ( numentstrs * numcites > maxentstrs ) )
{
{
(void) FPrintF( logfile , "%ld%s", (long)numentstrs * numcites , ": " ) ;
(void) FPrintFStdErr( "%ld%s", (long)numentstrs * numcites , ": " ) ;
}
{
printoverflow () ;
{
(void) FPrintF( logfile , "%s%ld\r", "total number of string entry-variables " , (long)maxentstrs ) ;
(void) FPrintFStdErr( "%s%ld\r", "total number of string entry-variables " , (long)maxentstrs ) ;
}
longjmp(jmp9998,1) ;
}
}
strentptr = 0 ;
while ( ( strentptr < numentstrs * numcites ) ) {
entrystrs [ strentptr ] [ 0 ] = 127 ;
incr ( strentptr ) ;
}
}
{
citeptr = 0 ;
while ( ( citeptr < numcites ) ) {
citeinfo [ citeptr ] = citeptr ;
incr ( citeptr ) ;
}
}
}
readcompleted = true ;
}
bufptr2 = svptr1 ;
last = svptr2 ;
tmpptr = bufptr2 ;
while ( ( tmpptr < last ) ) {
buffer [ tmpptr ] = svbuffer [ tmpptr ] ;
incr ( tmpptr ) ;
}
lab10: ;
}
void bstreversecommand (void) {
/* 10 */ if ( ( ! readseen ) )
{
{
(void) ReverseFPuts( logfile , "Illegal, reverse command before read command" ) ;
(void) FPrintFStdErr( "Illegal, reverse command before read command" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "reverse" ) ;
(void) FPrintFStdErr( "reverse" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
if ( ( buffer [ bufptr2 ] != 123 ) )
{
bstleftbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "reverse" ) ;
(void) FPrintFStdErr( "reverse" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "reverse" ) ;
(void) FPrintFStdErr( "reverse" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
scanidentifier ( 125 , 37 , 37 ) ;
if ( ( ( scanresult == 3 ) || ( scanresult == 1 ) ) )
;
else {
bstidprint () ;
{
{
(void) ReverseFPuts( logfile , "reverse" ) ;
(void) FPrintFStdErr( "reverse" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
;
#ifdef TRACE
{
outtoken ( logfile ) ;
}
{
(void) FPrintF( logfile , "%s\r", " is a to be iterated in reverse function" ) ;
}
#endif /* TRACE */
if ( ( badargumenttoken () ) )
goto lab10 ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "reverse" ) ;
(void) FPrintFStdErr( "reverse" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
if ( ( buffer [ bufptr2 ] != 125 ) )
{
bstrightbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "reverse" ) ;
(void) FPrintFStdErr( "reverse" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
{
initcommandexecution () ;
messwithentries = true ;
if ( ( numcites > 0 ) )
{
sortciteptr = numcites ;
do {
decr ( sortciteptr ) ;
citeptr = citeinfo [ sortciteptr ] ;
;
#ifdef TRACE
{
outpoolstr ( logfile , hashtext [ fnloc ] ) ;
}
{
(void) ReverseFPuts( logfile , " to be iterated in reverse on " ) ;
}
{
outpoolstr ( logfile , citelist [ citeptr ] ) ;
}
{
(void) FPutC('\r', logfile );
}
#endif /* TRACE */
executefn ( fnloc ) ;
checkcommandexecutio () ;
} while ( ! ( ( sortciteptr == 0 ) ) ) ;
}
}
lab10: ;
}
void bstsortcommand (void) {
/* 10 */ if ( ( ! readseen ) )
{
{
(void) ReverseFPuts( logfile , "Illegal, sort command before read command" ) ;
(void) FPrintFStdErr( "Illegal, sort command before read command" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
{
;
#ifdef TRACE
{
(void) FPrintF( logfile , "%s\r", "Sorting the entries" ) ;
}
#endif /* TRACE */
if ( ( numcites > 1 ) )
quicksort ( 0 , numcites - 1 ) ;
;
#ifdef TRACE
{
(void) FPrintF( logfile , "%s\r", "Done sorting" ) ;
}
#endif /* TRACE */
}
lab10: ;
}
void bststringscommand (void) {
/* 10 */ {
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "strings" ) ;
(void) FPrintFStdErr( "strings" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
if ( ( buffer [ bufptr2 ] != 123 ) )
{
bstleftbraceprint () ;
{
{
(void) ReverseFPuts( logfile , "strings" ) ;
(void) FPrintFStdErr( "strings" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
incr ( bufptr2 ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "strings" ) ;
(void) FPrintFStdErr( "strings" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
while ( ( buffer [ bufptr2 ] != 125 ) ) {
{
scanidentifier ( 125 , 37 , 37 ) ;
if ( ( ( scanresult == 3 ) || ( scanresult == 1 ) ) )
;
else {
bstidprint () ;
{
{
(void) ReverseFPuts( logfile , "strings" ) ;
(void) FPrintFStdErr( "strings" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
{
;
#ifdef TRACE
{
outtoken ( logfile ) ;
}
{
(void) FPrintF( logfile , "%s\r", " is a string global-variable" ) ;
}
#endif /* TRACE */
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
fnloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 11 , true
) ;
{
if ( ( hashfound ) )
{
alreadyseenfunctionp ( fnloc ) ;
goto lab10 ;
}
}
fntype [ fnloc ] = 8 ;
ilkinfo [ fnloc ] = numglbstrs ;
if ( ( numglbstrs == 10 ) )
{
printoverflow () ;
{
(void) FPrintF( logfile , "%s%ld\r", "number of string global-variables " , (long)10 ) ;
(void) FPrintFStdErr( "%s%ld\r", "number of string global-variables " , (long)10 ) ;
}
longjmp(jmp9998,1) ;
}
incr ( numglbstrs ) ;
}
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "strings" ) ;
(void) FPrintFStdErr( "strings" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
}
incr ( bufptr2 ) ;
lab10: ;
}
void getbstcommandandproc (void) {
/* 10 */ if ( ( ! scanalpha () ) )
{
{
(void) FPrintF( logfile , "%c%c%s", '"' , xchr [ buffer [ bufptr2 ] ] , "\" can't start a style-file command" ) ;
(void) FPrintFStdErr( "%c%c%s", '"' , xchr [ buffer [ bufptr2 ] ] , "\" can't start a style-file command" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
commandnum = ilkinfo [ strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 )
, 4 , false ) ] ;
if ( ( ! hashfound ) )
{
printatoken () ;
{
{
(void) ReverseFPuts( logfile , " is an illegal style-file command" ) ;
(void) FPrintFStdErr( " is an illegal style-file command" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
switch ( ( commandnum ) )
{case 0 :
bstentrycommand () ;
break ;
case 1 :
bstexecutecommand () ;
break ;
case 2 :
bstfunctioncommand () ;
break ;
case 3 :
bstintegerscommand () ;
break ;
case 4 :
bstiteratecommand () ;
break ;
case 5 :
bstmacrocommand () ;
break ;
case 6 :
bstreadcommand () ;
break ;
case 7 :
bstreversecommand () ;
break ;
case 8 :
bstsortcommand () ;
break ;
case 9 :
bststringscommand () ;
break ;
default:
{
{
(void) ReverseFPuts( logfile , "Unknown style-file command" ) ;
(void) FPrintFStdErr( "Unknown style-file command" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
break ;
}
lab10: ;
}
static void deinitialize(void);
static void vincerealloc(void);
// Added by Vince so we can re-run without quitting
void initialize (void) {
deinitialize();
schar i ;
hashloc k ;
/* Allocation has been changed by Vince */
#define ALLOC(t,p,c) { \
p = (t) chkalloc( (long) ((long)sizeof(*(p)) * ((long)c)), (long)1); \
if ( p==0) { SysBeep(5); exit(0); }; \
}
ALLOC(char*, strpool, poolsize+1);
ALLOC(short*, hashnext, 5001);
ALLOC(long*, hashtext, 5001);
ALLOC(char*, hashilk, 5001);
ALLOC(long*, ilkinfo,5001);
ALLOC(char*, fntype, 5001);
ALLOC(short*, wizfunctions, wizfnspace + 1);
ALLOC(long*, entryints, maxentints+1);
ALLOC(char(*)[101], entrystrs, maxentstrs+1);
ALLOC(char(*)[1001], globalstrs, 10);
ALLOC(long*, fieldinfo, maxfields + 1);
ALLOC(long*, citeinfo, maxcites + 1);
ALLOC(char*, buffer, bufsize + 1);
ALLOC(char*, svbuffer, bufsize + 1);
ALLOC(char*, exbuf, bufsize + 1);
ALLOC(char*, outbuf, bufsize + 1);
ALLOC(long*, nametok, bufsize + 1);
ALLOC(char*, namesepchar, bufsize + 1);
ALLOC(long*, citelist, maxcites + 1);
/* end of Vince's alterations */
bad = 0 ;
if ( ( minprintline < 3 ) )
bad = 1 ;
if ( ( maxprintline <= minprintline ) )
bad = 10 * bad + 2 ;
if ( ( maxprintline >= bufsize ) )
bad = 10 * bad + 3 ;
if ( ( 4253 < 128 ) )
bad = 10 * bad + 4 ;
if ( ( 4253 > 5000 ) )
bad = 10 * bad + 5 ;
if ( ( 4253 >= ( 16320 ) ) )
bad = 10 * bad + 6 ;
if ( ( maxstrings > 5000 ) )
bad = 10 * bad + 7 ;
if ( ( maxcites > maxstrings ) )
bad = 10 * bad + 8 ;
if ( ( entstrsize > bufsize ) )
bad = 10 * bad + 9 ;
if ( ( globstrsize > bufsize ) )
bad = 100 * bad + 11 ;
if ( ( 10 < 2 * 4 + 2 ) )
bad = 100 * bad + 22 ;
if ( ( bad > 0 ) )
{
(void) FPrintFStdErr( "%ld%s\r", (long)bad , " is a bad bad" ) ;
uexit ( 0 ) ;
}
history = 0 ;
xchr [ 32 ] = ' ' ;
xchr [ 33 ] = '!' ;
xchr [ 34 ] = '"' ;
xchr [ 35 ] = '#' ;
xchr [ 36 ] = '$' ;
xchr [ 37 ] = '%' ;
xchr [ 38 ] = '&' ;
xchr [ 39 ] = '\'' ;
xchr [ 40 ] = '(' ;
xchr [ 41 ] = ')' ;
xchr [ 42 ] = '*' ;
xchr [ 43 ] = '+' ;
xchr [ 44 ] = ',' ;
xchr [ 45 ] = '-' ;
xchr [ 46 ] = '.' ;
xchr [ 47 ] = '/' ;
xchr [ 48 ] = '0' ;
xchr [ 49 ] = '1' ;
xchr [ 50 ] = '2' ;
xchr [ 51 ] = '3' ;
xchr [ 52 ] = '4' ;
xchr [ 53 ] = '5' ;
xchr [ 54 ] = '6' ;
xchr [ 55 ] = '7' ;
xchr [ 56 ] = '8' ;
xchr [ 57 ] = '9' ;
xchr [ 58 ] = ':' ;
xchr [ 59 ] = ';' ;
xchr [ 60 ] = '<' ;
xchr [ 61 ] = '=' ;
xchr [ 62 ] = '>' ;
xchr [ 63 ] = '?' ;
xchr [ 64 ] = '@' ;
xchr [ 65 ] = 'A' ;
xchr [ 66 ] = 'B' ;
xchr [ 67 ] = 'C' ;
xchr [ 68 ] = 'D' ;
xchr [ 69 ] = 'E' ;
xchr [ 70 ] = 'F' ;
xchr [ 71 ] = 'G' ;
xchr [ 72 ] = 'H' ;
xchr [ 73 ] = 'I' ;
xchr [ 74 ] = 'J' ;
xchr [ 75 ] = 'K' ;
xchr [ 76 ] = 'L' ;
xchr [ 77 ] = 'M' ;
xchr [ 78 ] = 'N' ;
xchr [ 79 ] = 'O' ;
xchr [ 80 ] = 'P' ;
xchr [ 81 ] = 'Q' ;
xchr [ 82 ] = 'R' ;
xchr [ 83 ] = 'S' ;
xchr [ 84 ] = 'T' ;
xchr [ 85 ] = 'U' ;
xchr [ 86 ] = 'V' ;
xchr [ 87 ] = 'W' ;
xchr [ 88 ] = 'X' ;
xchr [ 89 ] = 'Y' ;
xchr [ 90 ] = 'Z' ;
xchr [ 91 ] = '[' ;
xchr [ 92 ] = '\\' ;
xchr [ 93 ] = ']' ;
xchr [ 94 ] = '^' ;
xchr [ 95 ] = '_' ;
xchr [ 96 ] = '`' ;
xchr [ 97 ] = 'a' ;
xchr [ 98 ] = 'b' ;
xchr [ 99 ] = 'c' ;
xchr [ 100 ] = 'd' ;
xchr [ 101 ] = 'e' ;
xchr [ 102 ] = 'f' ;
xchr [ 103 ] = 'g' ;
xchr [ 104 ] = 'h' ;
xchr [ 105 ] = 'i' ;
xchr [ 106 ] = 'j' ;
xchr [ 107 ] = 'k' ;
xchr [ 108 ] = 'l' ;
xchr [ 109 ] = 'm' ;
xchr [ 110 ] = 'n' ;
xchr [ 111 ] = 'o' ;
xchr [ 112 ] = 'p' ;
xchr [ 113 ] = 'q' ;
xchr [ 114 ] = 'r' ;
xchr [ 115 ] = 's' ;
xchr [ 116 ] = 't' ;
xchr [ 117 ] = 'u' ;
xchr [ 118 ] = 'v' ;
xchr [ 119 ] = 'w' ;
xchr [ 120 ] = 'x' ;
xchr [ 121 ] = 'y' ;
xchr [ 122 ] = 'z' ;
xchr [ 123 ] = '{' ;
xchr [ 124 ] = '|' ;
xchr [ 125 ] = '}' ;
xchr [ 126 ] = '~' ;
xchr [ 0 ] = ' ' ;
xchr [ 127 ] = ' ' ;
{register integer for_end; i = 1 ; for_end = 31 ; if ( i <= for_end) do
xchr [ i ] = ' ' ;
while ( i++ < for_end ) ; }
xchr [ 9 ] = chr ( 9 ) ;
{register integer for_end; i = 0 ; for_end = 127 ; if ( i <= for_end) do
xord [ chr ( i ) ] = 127 ;
while ( i++ < for_end ) ; }
{register integer for_end; i = 1 ; for_end = 126 ; if ( i <= for_end) do
xord [ xchr [ i ] ] = i ;
while ( i++ < for_end ) ; }
{register integer for_end; i = 0 ; for_end = 127 ; if ( i <= for_end) do
lexclass [ i ] = 5 ;
while ( i++ < for_end ) ; }
{register integer for_end; i = 0 ; for_end = 31 ; if ( i <= for_end) do
lexclass [ i ] = 0 ;
while ( i++ < for_end ) ; }
lexclass [ 127 ] = 0 ;
lexclass [ 9 ] = 1 ;
lexclass [ 32 ] = 1 ;
lexclass [ 126 ] = 4 ;
lexclass [ 45 ] = 4 ;
{register integer for_end; i = 48 ; for_end = 57 ; if ( i <= for_end) do
lexclass [ i ] = 3 ;
while ( i++ < for_end ) ; }
{register integer for_end; i = 65 ; for_end = 90 ; if ( i <= for_end) do
lexclass [ i ] = 2 ;
while ( i++ < for_end ) ; }
{register integer for_end; i = 97 ; for_end = 122 ; if ( i <= for_end) do
lexclass [ i ] = 2 ;
while ( i++ < for_end ) ; }
{register integer for_end; i = 0 ; for_end = 127 ; if ( i <= for_end) do
idclass [ i ] = 1 ;
while ( i++ < for_end ) ; }
{register integer for_end; i = 0 ; for_end = 31 ; if ( i <= for_end) do
idclass [ i ] = 0 ;
while ( i++ < for_end ) ; }
idclass [ 32 ] = 0 ;
idclass [ 9 ] = 0 ;
idclass [ 34 ] = 0 ;
idclass [ 35 ] = 0 ;
idclass [ 37 ] = 0 ;
idclass [ 39 ] = 0 ;
idclass [ 40 ] = 0 ;
idclass [ 41 ] = 0 ;
idclass [ 44 ] = 0 ;
idclass [ 61 ] = 0 ;
idclass [ 123 ] = 0 ;
idclass [ 125 ] = 0 ;
{register integer for_end; i = 0 ; for_end = 127 ; if ( i <= for_end) do
charwidth [ i ] = 0 ;
while ( i++ < for_end ) ; }
charwidth [ 32 ] = 278 ;
charwidth [ 33 ] = 278 ;
charwidth [ 34 ] = 500 ;
charwidth [ 35 ] = 833 ;
charwidth [ 36 ] = 500 ;
charwidth [ 37 ] = 833 ;
charwidth [ 38 ] = 778 ;
charwidth [ 39 ] = 278 ;
charwidth [ 40 ] = 389 ;
charwidth [ 41 ] = 389 ;
charwidth [ 42 ] = 500 ;
charwidth [ 43 ] = 778 ;
charwidth [ 44 ] = 278 ;
charwidth [ 45 ] = 333 ;
charwidth [ 46 ] = 278 ;
charwidth [ 47 ] = 500 ;
charwidth [ 48 ] = 500 ;
charwidth [ 49 ] = 500 ;
charwidth [ 50 ] = 500 ;
charwidth [ 51 ] = 500 ;
charwidth [ 52 ] = 500 ;
charwidth [ 53 ] = 500 ;
charwidth [ 54 ] = 500 ;
charwidth [ 55 ] = 500 ;
charwidth [ 56 ] = 500 ;
charwidth [ 57 ] = 500 ;
charwidth [ 58 ] = 278 ;
charwidth [ 59 ] = 278 ;
charwidth [ 60 ] = 278 ;
charwidth [ 61 ] = 778 ;
charwidth [ 62 ] = 472 ;
charwidth [ 63 ] = 472 ;
charwidth [ 64 ] = 778 ;
charwidth [ 65 ] = 750 ;
charwidth [ 66 ] = 708 ;
charwidth [ 67 ] = 722 ;
charwidth [ 68 ] = 764 ;
charwidth [ 69 ] = 681 ;
charwidth [ 70 ] = 653 ;
charwidth [ 71 ] = 785 ;
charwidth [ 72 ] = 750 ;
charwidth [ 73 ] = 361 ;
charwidth [ 74 ] = 514 ;
charwidth [ 75 ] = 778 ;
charwidth [ 76 ] = 625 ;
charwidth [ 77 ] = 917 ;
charwidth [ 78 ] = 750 ;
charwidth [ 79 ] = 778 ;
charwidth [ 80 ] = 681 ;
charwidth [ 81 ] = 778 ;
charwidth [ 82 ] = 736 ;
charwidth [ 83 ] = 556 ;
charwidth [ 84 ] = 722 ;
charwidth [ 85 ] = 750 ;
charwidth [ 86 ] = 750 ;
charwidth [ 87 ] = 1028 ;
charwidth [ 88 ] = 750 ;
charwidth [ 89 ] = 750 ;
charwidth [ 90 ] = 611 ;
charwidth [ 91 ] = 278 ;
charwidth [ 92 ] = 500 ;
charwidth [ 93 ] = 278 ;
charwidth [ 94 ] = 500 ;
charwidth [ 95 ] = 278 ;
charwidth [ 96 ] = 278 ;
charwidth [ 97 ] = 500 ;
charwidth [ 98 ] = 556 ;
charwidth [ 99 ] = 444 ;
charwidth [ 100 ] = 556 ;
charwidth [ 101 ] = 444 ;
charwidth [ 102 ] = 306 ;
charwidth [ 103 ] = 500 ;
charwidth [ 104 ] = 556 ;
charwidth [ 105 ] = 278 ;
charwidth [ 106 ] = 306 ;
charwidth [ 107 ] = 528 ;
charwidth [ 108 ] = 278 ;
charwidth [ 109 ] = 833 ;
charwidth [ 110 ] = 556 ;
charwidth [ 111 ] = 500 ;
charwidth [ 112 ] = 556 ;
charwidth [ 113 ] = 528 ;
charwidth [ 114 ] = 392 ;
charwidth [ 115 ] = 394 ;
charwidth [ 116 ] = 389 ;
charwidth [ 117 ] = 556 ;
charwidth [ 118 ] = 528 ;
charwidth [ 119 ] = 722 ;
charwidth [ 120 ] = 528 ;
charwidth [ 121 ] = 528 ;
charwidth [ 122 ] = 444 ;
charwidth [ 123 ] = 500 ;
charwidth [ 124 ] = 1000 ;
charwidth [ 125 ] = 500 ;
charwidth [ 126 ] = 500 ;
{register integer for_end; k = 1 ; for_end = 5000 ; if ( k <= for_end) do
{
hashnext [ k ] = 0 ;
hashtext [ k ] = 0 ;
}
while ( k++ < for_end ) ; }
hashused = 5001 ;
poolptr = 0 ;
strptr = 1 ;
strstart [ strptr ] = poolptr ;
bibptr = 0 ;
bibseen = false ;
bststr = 0 ;
bstseen = false ;
citeptr = 0 ;
citationseen = false ;
allentries = false ;
wizdefptr = 0 ;
numentints = 0 ;
numentstrs = 0 ;
numfields = 0 ;
strglbptr = 0 ;
while ( ( strglbptr < 10 ) ) {
glbstrptr [ strglbptr ] = 0 ;
glbstrend [ strglbptr ] = 0 ;
incr ( strglbptr ) ;
}
numglbstrs = 0 ;
entryseen = false ;
readseen = false ;
readperformed = false ;
readingcompleted = false ;
readcompleted = false ;
implfnnum = 0 ;
outbuflength = 0 ;
predefcertainstrings () ;
getthetoplevelauxfil () ;
}
static void deinitialize(void) {
// added these which seem to be important
citeptr = 0;
// this next one here caused me big problems
// it is probably indicative of a subtle bug in
// the old mac BibTeX that it was never zeroed.
citexptr = 0;
numcites = 0;
oldnumcites = 0;
strpool = 0;
hashnext = 0;
hashtext = 0;
hashilk = 0;
ilkinfo = 0;
fntype = 0;
wizfunctions = 0;
entryints = 0;
entrystrs = 0;
globalstrs = 0;
fieldinfo = 0;
citeinfo = 0;
buffer = 0;
svbuffer = 0;
exbuf = 0;
outbuf = 0;
nametok = 0;
namesepchar = 0;
citelist = 0;
lab31 = 0;
for(short i=0;i<=auxstacksize;i++) {
auxfile[i] = 0;
auxlnstack[i] = 0;
}
auxptr = 0;
bbllinenum = biblinenum = bstlinenum = 0;
bufptr2 = 0;
errcount = 0;
last = 0;
for(short i=0;i<70;i++) {
jmp32[i] = jmp9998[i] = 0;
}
}
#ifdef GIVE_UP_TIME
static void give_up_some_time(void);
void give_up_some_time(void){
cede_time();
vincerealloc();
}
#endif
void vincerealloc(void){
// reset to the beginning
ptohrealloc(1);
#undef ALLOC
#define ALLOC(t,p,c) p = (t) ptohrealloc(0);
ALLOC(char*, strpool, poolsize+1);
ALLOC(short*, hashnext, 5001);
ALLOC(long*, hashtext, 5001);
ALLOC(char*, hashilk, 5001);
ALLOC(long*, ilkinfo,5001);
ALLOC(char*, fntype, 5001);
ALLOC(short*, wizfunctions, wizfnspace + 1);
ALLOC(long*, entryints, maxentints+1);
ALLOC(char(*)[101], entrystrs, maxentstrs+1);
ALLOC(char(*)[1001], globalstrs, 10);
ALLOC(long*, fieldinfo, maxfields + 1);
ALLOC(long*, citeinfo, maxcites + 1);
ALLOC(char*, buffer, bufsize + 1);
ALLOC(char*, svbuffer, bufsize + 1);
ALLOC(char*, exbuf, bufsize + 1);
ALLOC(char*, outbuf, bufsize + 1);
ALLOC(long*, nametok, bufsize + 1);
ALLOC(char*, namesepchar, bufsize + 1);
ALLOC(long*, citelist, maxcites + 1);
}
void main_body(void) {
initialize () ;
//extern alphafile logfile;
//logfile = logfile;
{
(void) FPrintF( logfile , "%s\r", "This is BibTeX, C Version 0.99c" ) ;
(void) FPrintFStdErr( "%s\r", "This is BibTeX, C Version 0.99c" ) ;
}
{
(void) ReverseFPuts( logfile , "The top-level auxiliary file: " ) ;
(void) FPrintFStdErr( "The top-level auxiliary file: " ) ;
}
printauxname () ;
while ( lab31==0 ) {
incr ( auxlnstack [ auxptr ] ) ;
if ( ( ! inputln ( auxfile [ auxptr ] ) ) )
poptheauxstack () ;
else getauxcommandandproc () ;
}
#ifdef TRACE
{
(void) FPrintF( logfile , "%s\r", "Finished reading the auxiliary file(s)" ) ;
}
#endif /* TRACE */
lastcheckforauxerror () ;
if ( ( bststr == 0 ) )
goto lab9932 ;
bstlinenum = 0 ;
bbllinenum = 1 ;
bufptr2 = last ;
if(setjmp(jmp9998)==1) goto lab9998;if(setjmp(jmp32)==0)while(true)
{
if ( ( ! eatbstwhitespace () ) )
break ;
getbstcommandandproc () ;
}
aclose ( bstfile ) ;
lab9932: aclose ( bblfile ) ;
lab9998: {
if ( ( ( readperformed ) && ( ! readingcompleted ) ) )
{
{
(void) FPrintF( logfile , "%s%ld%s", "Aborted at line " , (long)biblinenum , " of file " ) ;
(void) FPrintFStdErr( "%s%ld%s", "Aborted at line " , (long)biblinenum , " of file " ) ;
}
printbibname () ;
}
traceandstatprinting () ;
switch ( ( history ) )
{case 0 :
;
break ;
case 1 :
{
if ( ( errcount == 1 ) )
{
(void) FPrintF( logfile , "%s\r", "(There was 1 warning)" ) ;
(void) FPrintFStdErr( "%s\r", "(There was 1 warning)" ) ;
}
else {
(void) FPrintF( logfile , "%s%ld%s\r", "(There were " , (long)errcount , " warnings)" ) ;
(void) FPrintFStdErr( "%s%ld%s\r", "(There were " , (long)errcount , " warnings)" ) ;
}
}
break ;
case 2 :
{
if ( ( errcount == 1 ) )
{
(void) FPrintF( logfile , "%s\r", "(There was 1 error message)" ) ;
(void) FPrintFStdErr( "%s\r", "(There was 1 error message)" ) ;
}
else {
(void) FPrintF( logfile , "%s%ld%s\r", "(There were " , (long)errcount , " error messages)" )
;
(void) FPrintFStdErr( "%s%ld%s\r", "(There were " , (long)errcount , " error messages)" )
;
}
}
break ;
case 3 :
{
(void) FPrintF( logfile , "%s\r", "(That was a fatal error)" ) ;
(void) FPrintFStdErr( "%s\r", "(That was a fatal error)" ) ;
}
break ;
default:
{
{
(void) ReverseFPuts( logfile , "History is bunk" ) ;
(void) FPrintFStdErr( "History is bunk" ) ;
}
printconfusion () ;
}
break ;
}
aclose ( logfile ) ;
}
lab9999: ;
}
#include "BibTeX.h"
#include "BibTeX.p"
#include "globals.h"
#include "coerce.h"
void
#ifdef STDC
zbuildin (pdstype pds ,pdslen len ,hashloc * fnhashloc ,bltinrange bltinnum )
#else
zbuildin ( pds , len , fnhashloc , bltinnum )
pdstype pds ;
pdslen len ;
hashloc * fnhashloc ;
bltinrange bltinnum ;
#endif
{predefine ( pds , len , 11 ) ;
* fnhashloc = predefloc ;
fntype [ *fnhashloc ] = 0 ;
ilkinfo [ *fnhashloc ] = bltinnum ;
;
#ifdef STAT
bltinloc [ bltinnum ] = *fnhashloc ;
executioncount [ bltinnum ] = 0 ;
#endif /* STAT */
}
void predefcertainstrings (void) {
predefine ( ".aux " , 4 , 7 ) ;
sauxextension = hashtext [ predefloc ] ;
predefine ( ".bbl " , 4 , 7 ) ;
sbblextension = hashtext [ predefloc ] ;
predefine ( ".blg " , 4 , 7 ) ;
slogextension = hashtext [ predefloc ] ;
predefine ( ".bst " , 4 , 7 ) ;
sbstextension = hashtext [ predefloc ] ;
predefine ( ".bib " , 4 , 7 ) ;
sbibextension = hashtext [ predefloc ] ;
predefine ( "texinputs: " , 10 , 8 ) ;
sbstarea = hashtext [ predefloc ] ;
predefine ( "texbib: " , 7 , 8 ) ;
sbibarea = hashtext [ predefloc ] ;
predefine ( "\\citation " , 9 , 2 ) ;
ilkinfo [ predefloc ] = 2 ;
predefine ( "\\bibdata " , 8 , 2 ) ;
ilkinfo [ predefloc ] = 0 ;
predefine ( "\\bibstyle " , 9 , 2 ) ;
ilkinfo [ predefloc ] = 1 ;
predefine ( "\\@input " , 7 , 2 ) ;
ilkinfo [ predefloc ] = 3 ;
predefine ( "entry " , 5 , 4 ) ;
ilkinfo [ predefloc ] = 0 ;
predefine ( "execute " , 7 , 4 ) ;
ilkinfo [ predefloc ] = 1 ;
predefine ( "function " , 8 , 4 ) ;
ilkinfo [ predefloc ] = 2 ;
predefine ( "integers " , 8 , 4 ) ;
ilkinfo [ predefloc ] = 3 ;
predefine ( "iterate " , 7 , 4 ) ;
ilkinfo [ predefloc ] = 4 ;
predefine ( "macro " , 5 , 4 ) ;
ilkinfo [ predefloc ] = 5 ;
predefine ( "read " , 4 , 4 ) ;
ilkinfo [ predefloc ] = 6 ;
predefine ( "reverse " , 7 , 4 ) ;
ilkinfo [ predefloc ] = 7 ;
predefine ( "sort " , 4 , 4 ) ;
ilkinfo [ predefloc ] = 8 ;
predefine ( "strings " , 7 , 4 ) ;
ilkinfo [ predefloc ] = 9 ;
predefine ( "comment " , 7 , 12 ) ;
ilkinfo [ predefloc ] = 0 ;
predefine ( "preamble " , 8 , 12 ) ;
ilkinfo [ predefloc ] = 1 ;
predefine ( "string " , 6 , 12 ) ;
ilkinfo [ predefloc ] = 2 ;
buildin ( "= " , 1 , bequals , 0 ) ;
buildin ( "> " , 1 , bgreaterthan , 1 ) ;
buildin ( "< " , 1 , blessthan , 2 ) ;
buildin ( "+ " , 1 , bplus , 3 ) ;
buildin ( "- " , 1 , bminus , 4 ) ;
buildin ( "* " , 1 , bconcatenate , 5 ) ;
buildin ( ":= " , 2 , bgets , 6 ) ;
buildin ( "add.period$ " , 11 , baddperiod , 7 ) ;
buildin ( "call.type$ " , 10 , bcalltype , 8 ) ;
buildin ( "change.case$" , 12 , bchangecase , 9 ) ;
buildin ( "chr.to.int$ " , 11 , bchrtoint , 10 ) ;
buildin ( "cite$ " , 5 , bcite , 11 ) ;
buildin ( "duplicate$ " , 10 , bduplicate , 12 ) ;
buildin ( "empty$ " , 6 , bempty , 13 ) ;
buildin ( "format.name$" , 12 , bformatname , 14 ) ;
buildin ( "if$ " , 3 , bif , 15 ) ;
buildin ( "int.to.chr$ " , 11 , binttochr , 16 ) ;
buildin ( "int.to.str$ " , 11 , binttostr , 17 ) ;
buildin ( "missing$ " , 8 , bmissing , 18 ) ;
buildin ( "newline$ " , 8 , bnewline , 19 ) ;
buildin ( "num.names$ " , 10 , bnumnames , 20 ) ;
buildin ( "pop$ " , 4 , bpop , 21 ) ;
buildin ( "preamble$ " , 9 , bpreamble , 22 ) ;
buildin ( "purify$ " , 7 , bpurify , 23 ) ;
buildin ( "quote$ " , 6 , bquote , 24 ) ;
buildin ( "skip$ " , 5 , bskip , 25 ) ;
buildin ( "stack$ " , 6 , bstack , 26 ) ;
buildin ( "substring$ " , 10 , bsubstring , 27 ) ;
buildin ( "swap$ " , 5 , bswap , 28 ) ;
buildin ( "text.length$" , 12 , btextlength , 29 ) ;
buildin ( "text.prefix$" , 12 , btextprefix , 30 ) ;
buildin ( "top$ " , 4 , btopstack , 31 ) ;
buildin ( "type$ " , 5 , btype , 32 ) ;
buildin ( "warning$ " , 8 , bwarning , 33 ) ;
buildin ( "width$ " , 6 , bwidth , 35 ) ;
buildin ( "while$ " , 6 , bwhile , 34 ) ;
buildin ( "width$ " , 6 , bwidth , 35 ) ;
buildin ( "write$ " , 6 , bwrite , 36 ) ;
predefine ( " " , 0 , 0 ) ;
snull = hashtext [ predefloc ] ;
fntype [ predefloc ] = 3 ;
predefine ( "default.type" , 12 , 0 ) ;
sdefault = hashtext [ predefloc ] ;
fntype [ predefloc ] = 3 ;
bdefault = bskip ;
preambleptr = 0 ;
predefine ( "i " , 1 , 14 ) ;
ilkinfo [ predefloc ] = 0 ;
predefine ( "j " , 1 , 14 ) ;
ilkinfo [ predefloc ] = 1 ;
predefine ( "oe " , 2 , 14 ) ;
ilkinfo [ predefloc ] = 2 ;
predefine ( "OE " , 2 , 14 ) ;
ilkinfo [ predefloc ] = 3 ;
predefine ( "ae " , 2 , 14 ) ;
ilkinfo [ predefloc ] = 4 ;
predefine ( "AE " , 2 , 14 ) ;
ilkinfo [ predefloc ] = 5 ;
predefine ( "aa " , 2 , 14 ) ;
ilkinfo [ predefloc ] = 6 ;
predefine ( "AA " , 2 , 14 ) ;
ilkinfo [ predefloc ] = 7 ;
predefine ( "o " , 1 , 14 ) ;
ilkinfo [ predefloc ] = 8 ;
predefine ( "O " , 1 , 14 ) ;
ilkinfo [ predefloc ] = 9 ;
predefine ( "l " , 1 , 14 ) ;
ilkinfo [ predefloc ] = 10 ;
predefine ( "L " , 1 , 14 ) ;
ilkinfo [ predefloc ] = 11 ;
predefine ( "ss " , 2 , 14 ) ;
ilkinfo [ predefloc ] = 12 ;
predefine ( "crossref " , 8 , 11 ) ;
fntype [ predefloc ] = 4 ;
ilkinfo [ predefloc ] = numfields ;
crossrefnum = numfields ;
incr ( numfields ) ;
numpredefinedfields = numfields ;
predefine ( "sort.key$ " , 9 , 11 ) ;
fntype [ predefloc ] = 6 ;
ilkinfo [ predefloc ] = numentstrs ;
sortkeynum = numentstrs ;
incr ( numentstrs ) ;
predefine ( "entry.max$ " , 10 , 11 ) ;
fntype [ predefloc ] = 7 ;
ilkinfo [ predefloc ] = entstrsize ;
predefine ( "global.max$ " , 11 , 11 ) ;
fntype [ predefloc ] = 7 ;
ilkinfo [ predefloc ] = globstrsize ;
}
#ifdef STDC
boolean zscan1 (ASCIIcode char1 )
#else
boolean zscan1 ( char1 )
ASCIIcode char1 ;
#endif
{register boolean Result; bufptr1 = bufptr2 ;
while ( ( ( buffer [ bufptr2 ] != char1 ) && ( bufptr2 < last ) ) ) incr (
bufptr2 ) ;
if ( ( bufptr2 < last ) )
Result = true ;
else Result = false ;
return(Result) ;
}
#ifdef STDC
boolean zscan1white (ASCIIcode char1 )
#else
boolean zscan1white ( char1 )
ASCIIcode char1 ;
#endif
{register boolean Result; bufptr1 = bufptr2 ;
while ( ( ( lexclass [ buffer [ bufptr2 ] ] != 1 ) && ( buffer [ bufptr2 ]
!= char1 ) && ( bufptr2 < last ) ) ) incr ( bufptr2 ) ;
if ( ( bufptr2 < last ) )
Result = true ;
else Result = false ;
return(Result) ;
}
#ifdef STDC
boolean zscan2 (ASCIIcode char1 ,ASCIIcode char2 )
#else
boolean zscan2 ( char1 , char2 )
ASCIIcode char1 , char2 ;
#endif
{register boolean Result; bufptr1 = bufptr2 ;
while ( ( ( buffer [ bufptr2 ] != char1 ) && ( buffer [ bufptr2 ] != char2 )
&& ( bufptr2 < last ) ) ) incr ( bufptr2 ) ;
if ( ( bufptr2 < last ) )
Result = true ;
else Result = false ;
return(Result) ;
}
#ifdef STDC
boolean zscan2white (ASCIIcode char1 ,ASCIIcode char2 )
#else
boolean zscan2white ( char1 , char2 )
ASCIIcode char1 , char2 ;
#endif
{register boolean Result; bufptr1 = bufptr2 ;
while ( ( ( buffer [ bufptr2 ] != char1 ) && ( buffer [ bufptr2 ] != char2 )
&& ( lexclass [ buffer [ bufptr2 ] ] != 1 ) && ( bufptr2 < last ) ) ) incr (
bufptr2 ) ;
if ( ( bufptr2 < last ) )
Result = true ;
else Result = false ;
return(Result) ;
}
#ifdef STDC
boolean zscan3 (ASCIIcode char1 ,ASCIIcode char2 ,ASCIIcode char3 )
#else
boolean zscan3 ( char1 , char2 , char3 )
ASCIIcode char1 , char2 , char3 ;
#endif
{register boolean Result; bufptr1 = bufptr2 ;
while ( ( ( buffer [ bufptr2 ] != char1 ) && ( buffer [ bufptr2 ] != char2 )
&& ( buffer [ bufptr2 ] != char3 ) && ( bufptr2 < last ) ) ) incr ( bufptr2
) ;
if ( ( bufptr2 < last ) )
Result = true ;
else Result = false ;
return(Result) ;
}
boolean scanalpha () {
register boolean Result; bufptr1 = bufptr2 ;
while ( ( ( lexclass [ buffer [ bufptr2 ] ] == 2 ) && ( bufptr2 < last ) ) )
incr ( bufptr2 ) ;
if ( ( ( bufptr2 - bufptr1 ) == 0 ) )
Result = false ;
else Result = true ;
return(Result) ;
}
void
#ifdef STDC
zscanidentifier (ASCIIcode char1 ,ASCIIcode char2 ,ASCIIcode char3 )
#else
zscanidentifier ( char1 , char2 , char3 )
ASCIIcode char1 , char2 , char3 ;
#endif
{bufptr1 = bufptr2 ;
if ( ( lexclass [ buffer [ bufptr2 ] ] != 3 ) )
while ( ( ( idclass [ buffer [ bufptr2 ] ] == 1 ) && ( bufptr2 < last ) ) )
incr ( bufptr2 ) ;
if ( ( ( bufptr2 - bufptr1 ) == 0 ) )
scanresult = 0 ;
else if ( ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) || ( bufptr2 == last )
) )
scanresult = 3 ;
else if ( ( ( buffer [ bufptr2 ] == char1 ) || ( buffer [ bufptr2 ] == char2
) || ( buffer [ bufptr2 ] == char3 ) ) )
scanresult = 1 ;
else scanresult = 2 ;
}
boolean scannonneginteger () {
register boolean Result; bufptr1 = bufptr2 ;
tokenvalue = 0 ;
while ( ( ( lexclass [ buffer [ bufptr2 ] ] == 3 ) && ( bufptr2 < last ) ) )
{
tokenvalue = tokenvalue * 10 + ( buffer [ bufptr2 ] - 48 ) ;
incr ( bufptr2 ) ;
}
if ( ( ( bufptr2 - bufptr1 ) == 0 ) )
Result = false ;
else Result = true ;
return(Result) ;
}
boolean scaninteger () {
register boolean Result; schar signlength ;
bufptr1 = bufptr2 ;
if ( ( buffer [ bufptr2 ] == 45 ) )
{
signlength = 1 ;
incr ( bufptr2 ) ;
}
else signlength = 0 ;
tokenvalue = 0 ;
while ( ( ( lexclass [ buffer [ bufptr2 ] ] == 3 ) && ( bufptr2 < last ) ) )
{
tokenvalue = tokenvalue * 10 + ( buffer [ bufptr2 ] - 48 ) ;
incr ( bufptr2 ) ;
}
if ( ( ( signlength == 1 ) ) )
tokenvalue = - (integer) tokenvalue ;
if ( ( ( bufptr2 - bufptr1 ) == signlength ) )
Result = false ;
else Result = true ;
return(Result) ;
}
boolean scanwhitespace () {
register boolean Result; while ( ( ( lexclass [
buffer [ bufptr2 ] ] == 1 ) && ( bufptr2 < last ) ) ) incr ( bufptr2 ) ;
if ( ( bufptr2 < last ) )
Result = true ;
else Result = false ;
return(Result) ;
}
boolean eatbstwhitespace () {
/* 10 */ register boolean Result; while ( true )
{
if ( ( scanwhitespace () ) )
if ( ( buffer [ bufptr2 ] != 37 ) )
{
Result = true ;
goto lab10 ;
}
if ( ( ! inputln ( bstfile ) ) )
{
Result = false ;
goto lab10 ;
}
incr ( bstlinenum ) ;
bufptr2 = 0 ;
}
lab10: ;
return(Result) ;
}
void skiptokenprint (void) {
{
(void) FPutC( '-' , logfile );
(void) FPutC( '-' );
}
bstlnnumprint () ;
markerror () ;
if ( ( scan2white ( 125 , 37 ) ) )
;
}
void printrecursionillega (void) {
;
#ifdef TRACE
{
(void) FPutC('\r', logfile );
}
#endif /* TRACE */
{
(void) FPrintF( logfile , "%s\r", "Curse you, wizard, before you recurse me:" ) ;
(void) FPrintFStdErr( "%s\r", "Curse you, wizard, before you recurse me:" ) ;
}
{
(void) ReverseFPuts( logfile , "function " ) ;
(void) FPrintFStdErr( "function " ) ;
}
printatoken () ;
{
(void) FPrintF( logfile , "%s\r", " is illegal in its own definition" ) ;
(void) FPrintFStdErr( "%s\r", " is illegal in its own definition" ) ;
}
skiptokenprint () ;
}
void skptokenunknownfunct (void) {
printatoken () ;
{
(void) ReverseFPuts( logfile , " is an unknown function" ) ;
(void) FPrintFStdErr( " is an unknown function" ) ;
}
skiptokenprint () ;
}
void skipillegalstuffafte (void) {
{
(void) FPrintF( logfile , "%c%c%s", '"' , xchr [ buffer [ bufptr2 ] ] , "\" can't follow a literal" ) ;
(void) FPrintFStdErr( "%c%c%s", '"' , xchr [ buffer [ bufptr2 ] ] , "\" can't follow a literal" ) ;
}
skiptokenprint () ;
}
void
#ifdef STDC
zscanfndef (hashloc fnhashloc )
#else
zscanfndef ( fnhashloc )
hashloc fnhashloc ;
#endif
{/* 25 10 */ typedef integer fndefloc ;
hashptr2 singlfunction[singlefnspace + 1] ;
fndefloc singleptr ;
fndefloc copyptr ;
bufpointer endofnum ;
hashloc implfnloc ;
{
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "function" ) ;
(void) FPrintFStdErr( "function" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
singleptr = 0 ;
while ( ( buffer [ bufptr2 ] != 125 ) ) {
switch ( ( buffer [ bufptr2 ] ) )
{case 35 :
{
incr ( bufptr2 ) ;
if ( ( ! scaninteger () ) )
{
{
(void) ReverseFPuts( logfile , "Illegal integer in integer literal" ) ;
(void) FPrintFStdErr( "Illegal integer in integer literal" ) ;
}
skiptokenprint () ;
goto lab25 ;
}
;
#ifdef TRACE
{
(void) FPutC( '#' , logfile );
}
{
outtoken ( logfile ) ;
}
{
(void) FPrintF( logfile , "%s%ld\r", " is an integer literal with value " , (long)tokenvalue ) ;
}
#endif /* TRACE */
literalloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 1
, true ) ;
if ( ( ! hashfound ) )
{
fntype [ literalloc ] = 2 ;
ilkinfo [ literalloc ] = tokenvalue ;
}
if ( ( ( lexclass [ buffer [ bufptr2 ] ] != 1 ) && ( bufptr2 < last )
&& ( buffer [ bufptr2 ] != 125 ) && ( buffer [ bufptr2 ] != 37 ) ) )
{
skipillegalstuffafte () ;
goto lab25 ;
}
{
singlfunction [ singleptr ] = literalloc ;
if ( ( singleptr == singlefnspace ) )
singlfnoverflow () ;
incr ( singleptr ) ;
}
}
break ;
case 34 :
{
incr ( bufptr2 ) ;
if ( ( ! scan1 ( 34 ) ) )
{
{
(void) FPrintF( logfile , "%s%c%s", "No `" , xchr [ 34 ] , "' to end string literal" ) ;
(void) FPrintFStdErr( "%s%c%s", "No `" , xchr [ 34 ] , "' to end string literal" ) ;
}
skiptokenprint () ;
goto lab25 ;
}
;
#ifdef TRACE
{
(void) FPutC( '"' , logfile );
}
{
outtoken ( logfile ) ;
}
{
(void) FPutC( '"' , logfile );
}
{
(void) FPrintF( logfile , "%s\r", " is a string literal" ) ;
}
#endif /* TRACE */
literalloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 0
, true ) ;
fntype [ literalloc ] = 3 ;
incr ( bufptr2 ) ;
if ( ( ( lexclass [ buffer [ bufptr2 ] ] != 1 ) && ( bufptr2 < last )
&& ( buffer [ bufptr2 ] != 125 ) && ( buffer [ bufptr2 ] != 37 ) ) )
{
skipillegalstuffafte () ;
goto lab25 ;
}
{
singlfunction [ singleptr ] = literalloc ;
if ( ( singleptr == singlefnspace ) )
singlfnoverflow () ;
incr ( singleptr ) ;
}
}
break ;
case 39 :
{
incr ( bufptr2 ) ;
if ( ( scan2white ( 125 , 37 ) ) )
;
;
#ifdef TRACE
{
(void) FPutC( '\'' , logfile );
}
{
outtoken ( logfile ) ;
}
{
(void) ReverseFPuts( logfile , " is a quoted function " ) ;
}
#endif /* TRACE */
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
fnloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 11 ,
false ) ;
if ( ( ! hashfound ) )
{
skptokenunknownfunct () ;
goto lab25 ;
}
else {
if ( ( fnloc == wizloc ) )
{
printrecursionillega () ;
goto lab25 ;
}
else {
;
#ifdef TRACE
{
(void) ReverseFPuts( logfile , "of type " ) ;
}
traceprfnclass ( fnloc ) ;
{
(void) FPutC('\r', logfile );
}
#endif /* TRACE */
{
singlfunction [ singleptr ] = 0 ;
if ( ( singleptr == singlefnspace ) )
singlfnoverflow () ;
incr ( singleptr ) ;
}
{
singlfunction [ singleptr ] = fnloc ;
if ( ( singleptr == singlefnspace ) )
singlfnoverflow () ;
incr ( singleptr ) ;
}
}
}
}
break ;
case 123 :
{
exbuf [ 0 ] = 39 ;
inttoASCII ( implfnnum , exbuf , 1 , endofnum ) ;
implfnloc = strlookup ( exbuf , 0 , endofnum , 11 , true ) ;
if ( ( hashfound ) )
{
{
(void) ReverseFPuts( logfile , "Already encountered implicit function" ) ;
(void) FPrintFStdErr( "Already encountered implicit function" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
;
#ifdef TRACE
{
outpoolstr ( logfile , hashtext [ implfnloc ] ) ;
}
{
(void) FPrintF( logfile , "%s\r", " is an implicit function" ) ;
}
#endif /* TRACE */
incr ( implfnnum ) ;
fntype [ implfnloc ] = 1 ;
{
singlfunction [ singleptr ] = 0 ;
if ( ( singleptr == singlefnspace ) )
singlfnoverflow () ;
incr ( singleptr ) ;
}
{
singlfunction [ singleptr ] = implfnloc ;
if ( ( singleptr == singlefnspace ) )
singlfnoverflow () ;
incr ( singleptr ) ;
}
incr ( bufptr2 ) ;
scanfndef ( implfnloc ) ;
}
break ;
default:
{
if ( ( scan2white ( 125 , 37 ) ) )
;
;
#ifdef TRACE
{
outtoken ( logfile ) ;
}
{
(void) ReverseFPuts( logfile , " is a function " ) ;
}
#endif /* TRACE */
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
fnloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 11 ,
false ) ;
if ( ( ! hashfound ) )
{
skptokenunknownfunct () ;
goto lab25 ;
}
else if ( ( fnloc == wizloc ) )
{
printrecursionillega () ;
goto lab25 ;
}
else {
;
#ifdef TRACE
{
(void) ReverseFPuts( logfile , "of type " ) ;
}
traceprfnclass ( fnloc ) ;
{
(void) FPutC('\r', logfile );
}
#endif /* TRACE */
{
singlfunction [ singleptr ] = fnloc ;
if ( ( singleptr == singlefnspace ) )
singlfnoverflow () ;
incr ( singleptr ) ;
}
}
}
break ;
}
lab25: {
if ( ( ! eatbstwhitespace () ) )
{
eatbstprint () ;
{
{
(void) ReverseFPuts( logfile , "function" ) ;
(void) FPrintFStdErr( "function" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
}
}
}
}
{
{
singlfunction [ singleptr ] = 5001 ;
if ( ( singleptr == singlefnspace ) )
singlfnoverflow () ;
incr ( singleptr ) ;
}
if ( ( singleptr + wizdefptr > wizfnspace ) )
{
{
(void) FPrintF( logfile , "%ld%s", (long)singleptr + wizdefptr , ": " ) ;
(void) FPrintFStdErr( "%ld%s", (long)singleptr + wizdefptr , ": " ) ;
}
{
printoverflow () ;
{
(void) FPrintF( logfile , "%s%ld\r", "wizard-defined function space " , (long)wizfnspace )
;
(void) FPrintFStdErr( "%s%ld\r", "wizard-defined function space " , (long)wizfnspace ) ;
}
longjmp(jmp9998,1) ;
}
}
ilkinfo [ fnhashloc ] = wizdefptr ;
copyptr = 0 ;
while ( ( copyptr < singleptr ) ) {
wizfunctions [ wizdefptr ] = singlfunction [ copyptr ] ;
incr ( copyptr ) ;
incr ( wizdefptr ) ;
}
}
incr ( bufptr2 ) ;
lab10: ;
}
boolean eatbibwhitespace () {
/* 10 */ register boolean Result; while ( ( !
scanwhitespace () ) ) {
if ( ( ! inputln ( bibfile [ bibptr ] ) ) )
{
Result = false ;
goto lab10 ;
}
incr ( biblinenum ) ;
bufptr2 = 0 ;
}
Result = true ;
lab10: ;
return(Result) ;
}
boolean compressbibwhite () {
/* 10 */ register boolean Result; Result = false
;
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = 32 ;
incr ( exbufptr ) ;
}
}
while ( ( ! scanwhitespace () ) ) {
if ( ( ! inputln ( bibfile [ bibptr ] ) ) )
{
eatbibprint () ;
goto lab10 ;
}
incr ( biblinenum ) ;
bufptr2 = 0 ;
}
Result = true ;
lab10: ;
return(Result) ;
}
boolean scanbalancedbraces () {
/* 15 10 */ register boolean Result; Result =
false ;
incr ( bufptr2 ) ;
{
if ( ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) || ( bufptr2 == last ) ) )
if ( ( ! compressbibwhite () ) )
goto lab10 ;
}
if ( ( exbufptr > 1 ) )
if ( ( exbuf [ exbufptr - 1 ] == 32 ) )
if ( ( exbuf [ exbufptr - 2 ] == 32 ) )
decr ( exbufptr ) ;
bibbracelevel = 0 ;
if ( ( storefield ) )
{
while ( ( buffer [ bufptr2 ] != rightstrdelim ) ) switch ( ( buffer [
bufptr2 ] ) )
{case 123 :
{
incr ( bibbracelevel ) ;
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = 123 ;
incr ( exbufptr ) ;
}
}
incr ( bufptr2 ) ;
{
if ( ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) || ( bufptr2 == last
) ) )
if ( ( ! compressbibwhite () ) )
goto lab10 ;
}
{
while ( true ) switch ( ( buffer [ bufptr2 ] ) )
{case 125 :
{
decr ( bibbracelevel ) ;
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = 125 ;
incr ( exbufptr ) ;
}
}
incr ( bufptr2 ) ;
{
if ( ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) || ( bufptr2
== last ) ) )
if ( ( ! compressbibwhite () ) )
goto lab10 ;
}
if ( ( bibbracelevel == 0 ) )
goto lab15 ;
}
break ;
case 123 :
{
incr ( bibbracelevel ) ;
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = 123 ;
incr ( exbufptr ) ;
}
}
incr ( bufptr2 ) ;
{
if ( ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) || ( bufptr2
== last ) ) )
if ( ( ! compressbibwhite () ) )
goto lab10 ;
}
}
break ;
default:
{
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = buffer [ bufptr2 ] ;
incr ( exbufptr ) ;
}
}
incr ( bufptr2 ) ;
{
if ( ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) || ( bufptr2
== last ) ) )
if ( ( ! compressbibwhite () ) )
goto lab10 ;
}
}
break ;
}
lab15: ;
}
}
break ;
case 125 :
{
bibunbalancedbracesp () ;
goto lab10 ;
}
break ;
default:
{
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = buffer [ bufptr2 ] ;
incr ( exbufptr ) ;
}
}
incr ( bufptr2 ) ;
{
if ( ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) || ( bufptr2 == last
) ) )
if ( ( ! compressbibwhite () ) )
goto lab10 ;
}
}
break ;
}
}
else {
while ( ( buffer [ bufptr2 ] != rightstrdelim ) ) if ( ( buffer [ bufptr2
] == 123 ) )
{
incr ( bibbracelevel ) ;
incr ( bufptr2 ) ;
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
while ( ( bibbracelevel > 0 ) ) {
if ( ( buffer [ bufptr2 ] == 125 ) )
{
decr ( bibbracelevel ) ;
incr ( bufptr2 ) ;
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
}
else if ( ( buffer [ bufptr2 ] == 123 ) )
{
incr ( bibbracelevel ) ;
incr ( bufptr2 ) ;
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
}
else {
incr ( bufptr2 ) ;
if ( ( ! scan2 ( 125 , 123 ) ) )
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
}
}
}
else if ( ( buffer [ bufptr2 ] == 125 ) )
{
bibunbalancedbracesp () ;
goto lab10 ;
}
else {
incr ( bufptr2 ) ;
if ( ( ! scan3 ( rightstrdelim , 123 , 125 ) ) )
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
}
}
incr ( bufptr2 ) ;
Result = true ;
lab10: ;
return(Result) ;
}
boolean scanafieldtokenandea () {
/* 10 */ register boolean Result; Result =
false ;
switch ( ( buffer [ bufptr2 ] ) )
{case 123 :
{
rightstrdelim = 125 ;
if ( ( ! scanbalancedbraces () ) )
goto lab10 ;
}
break ;
case 34 :
{
rightstrdelim = 34 ;
if ( ( ! scanbalancedbraces () ) )
goto lab10 ;
}
break ;
case 48 :
case 49 :
case 50 :
case 51 :
case 52 :
case 53 :
case 54 :
case 55 :
case 56 :
case 57 :
{
if ( ( ! scannonneginteger () ) )
{
{
(void) ReverseFPuts( logfile , "A digit disappeared" ) ;
(void) FPrintFStdErr( "A digit disappeared" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
if ( ( storefield ) )
{
tmpptr = bufptr1 ;
while ( ( tmpptr < bufptr2 ) ) {
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = buffer [ tmpptr ] ;
incr ( exbufptr ) ;
}
}
incr ( tmpptr ) ;
}
}
}
break ;
default:
{
scanidentifier ( 44 , rightouterdelim , 35 ) ;
{
if ( ( ( scanresult == 3 ) || ( scanresult == 1 ) ) )
;
else {
bibidprint () ;
{
{
(void) ReverseFPuts( logfile , "a field part" ) ;
(void) FPrintFStdErr( "a field part" ) ;
}
biberrprint () ;
goto lab10 ;
}
}
}
if ( ( storefield ) )
{
lowercase ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
macronameloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ,
13 , false ) ;
storetoken = true ;
if ( ( atbibcommand ) )
if ( ( commandnum == 2 ) )
if ( ( macronameloc == curmacroloc ) )
{
storetoken = false ;
{
macrowarnprint () ;
{
{
(void) FPrintF( logfile , "%s\r", "used in its own definition" ) ;
(void) FPrintFStdErr( "%s\r", "used in its own definition" ) ;
}
bibwarnprint () ;
}
}
}
if ( ( ! hashfound ) )
{
storetoken = false ;
{
macrowarnprint () ;
{
{
(void) FPrintF( logfile , "%s\r", "undefined" ) ;
(void) FPrintFStdErr( "%s\r", "undefined" ) ;
}
bibwarnprint () ;
}
}
}
if ( ( storetoken ) )
{
tmpptr = strstart [ ilkinfo [ macronameloc ] ] ;
tmpendptr = strstart [ ilkinfo [ macronameloc ] + 1 ] ;
if ( ( exbufptr == 0 ) )
if ( ( ( lexclass [ strpool [ tmpptr ] ] == 1 ) && ( tmpptr <
tmpendptr ) ) )
{
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = 32 ;
incr ( exbufptr ) ;
}
}
incr ( tmpptr ) ;
while ( ( ( lexclass [ strpool [ tmpptr ] ] == 1 ) && ( tmpptr <
tmpendptr ) ) ) incr ( tmpptr ) ;
}
while ( ( tmpptr < tmpendptr ) ) {
if ( ( lexclass [ strpool [ tmpptr ] ] != 1 ) )
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = strpool [ tmpptr ] ;
incr ( exbufptr ) ;
}
}
else if ( ( exbuf [ exbufptr - 1 ] != 32 ) )
{
if ( ( exbufptr == bufsize ) )
{
bibfieldtoolongprint () ;
goto lab10 ;
}
else {
exbuf [ exbufptr ] = 32 ;
incr ( exbufptr ) ;
}
}
incr ( tmpptr ) ;
}
}
}
}
break ;
}
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
Result = true ;
lab10: ;
return(Result) ;
}
#include "BibTeX.h"
#include "BibTeX.p"
#include "globals.h"
#include "coerce.h"
boolean scanandstorethefield () {
/* 10 */ register boolean Result; Result =
false ;
exbufptr = 0 ;
if ( ( ! scanafieldtokenandea () ) )
goto lab10 ;
while ( ( buffer [ bufptr2 ] == 35 ) ) {
incr ( bufptr2 ) ;
{
if ( ( ! eatbibwhitespace () ) )
{
eatbibprint () ;
goto lab10 ;
}
}
if ( ( ! scanafieldtokenandea () ) )
goto lab10 ;
}
if ( ( storefield ) )
{
if ( ( ! atbibcommand ) )
if ( ( exbufptr > 0 ) )
if ( ( exbuf [ exbufptr - 1 ] == 32 ) )
decr ( exbufptr ) ;
if ( ( ( ! atbibcommand ) && ( exbuf [ 0 ] == 32 ) && ( exbufptr > 0 ) ) )
exbufxptr = 1 ;
else exbufxptr = 0 ;
fieldvalloc = strlookup ( exbuf , exbufxptr , exbufptr - exbufxptr , 0 ,
true ) ;
fntype [ fieldvalloc ] = 3 ;
;
#ifdef TRACE
{
(void) FPutC( '"' , logfile );
}
{
outpoolstr ( logfile , hashtext [ fieldvalloc ] ) ;
}
{
(void) FPrintF( logfile , "%s\r", "\" is a field value" ) ;
}
#endif /* TRACE */
if ( ( atbibcommand ) )
{
switch ( ( commandnum ) )
{case 1 :
{
spreamble [ preambleptr ] = hashtext [ fieldvalloc ] ;
incr ( preambleptr ) ;
}
break ;
case 2 :
ilkinfo [ curmacroloc ] = hashtext [ fieldvalloc ] ;
break ;
default:
bibcmdconfusion () ;
break ;
}
}
else {
fieldptr = entryciteptr * numfields + ilkinfo [ fieldnameloc ] ;
if ( ( fieldinfo [ fieldptr ] != 0 ) )
{
{
(void) ReverseFPuts( logfile , "Warning--I'm ignoring " ) ;
(void) FPrintFStdErr( "Warning--I'm ignoring " ) ;
}
printapoolstr ( citelist [ entryciteptr ] ) ;
{
(void) ReverseFPuts( logfile , "'s extra \"" ) ;
(void) FPrintFStdErr( "'s extra \"" ) ;
}
printapoolstr ( hashtext [ fieldnameloc ] ) ;
{
{
(void) FPrintF( logfile , "%s\r", "\" field" ) ;
(void) FPrintFStdErr( "%s\r", "\" field" ) ;
}
bibwarnprint () ;
}
}
else {
fieldinfo [ fieldptr ] = hashtext [ fieldvalloc ] ;
if ( ( ( ilkinfo [ fieldnameloc ] == crossrefnum ) && ( ! allentries )
) )
{
tmpptr = exbufxptr ;
while ( ( tmpptr < exbufptr ) ) {
outbuf [ tmpptr ] = exbuf [ tmpptr ] ;
incr ( tmpptr ) ;
}
lowercase ( outbuf , exbufxptr , exbufptr - exbufxptr ) ;
lcciteloc = strlookup ( outbuf , exbufxptr , exbufptr - exbufxptr ,
10 , true ) ;
if ( ( hashfound ) )
{
citeloc = ilkinfo [ lcciteloc ] ;
if ( ( ilkinfo [ citeloc ] >= oldnumcites ) )
incr ( citeinfo [ ilkinfo [ citeloc ] ] ) ;
}
else {
citeloc = strlookup ( exbuf , exbufxptr , exbufptr - exbufxptr , 9
, true ) ;
if ( ( hashfound ) )
hashciteconfusion () ;
adddatabasecite ( citeptr ) ;
citeinfo [ ilkinfo [ citeloc ] ] = 1 ;
}
}
}
}
}
Result = true ;
lab10: ;
return(Result) ;
}
void
#ifdef STDC
zdecrbracelevel (strnumber poplitvar )
#else
zdecrbracelevel ( poplitvar )
strnumber poplitvar ;
#endif
{if ( ( bracelevel == 0 ) )
bracesunbalancedcomp ( poplitvar ) ;
else decr ( bracelevel ) ;
}
void
#ifdef STDC
zcheckbracelevel (strnumber poplitvar )
#else
zcheckbracelevel ( poplitvar )
strnumber poplitvar ;
#endif
{if ( ( bracelevel > 0 ) )
bracesunbalancedcomp ( poplitvar ) ;
}
void
#ifdef STDC
znamescanforand (strnumber poplitvar )
#else
znamescanforand ( poplitvar )
strnumber poplitvar ;
#endif
{bracelevel = 0 ;
precedingwhite = false ;
andfound = false ;
while ( ( ( ! andfound ) && ( exbufptr < exbuflength ) ) ) switch ( ( exbuf
[ exbufptr ] ) )
{case 97 :
case 65 :
{
incr ( exbufptr ) ;
if ( ( precedingwhite ) )
{
if ( ( exbufptr <= ( exbuflength - 3 ) ) )
if ( ( ( exbuf [ exbufptr ] == 110 ) || ( exbuf [ exbufptr ] == 78 ) )
)
if ( ( ( exbuf [ exbufptr + 1 ] == 100 ) || ( exbuf [ exbufptr + 1 ]
== 68 ) ) )
if ( ( lexclass [ exbuf [ exbufptr + 2 ] ] == 1 ) )
{
exbufptr = exbufptr + 2 ;
andfound = true ;
}
}
precedingwhite = false ;
}
break ;
case 123 :
{
incr ( bracelevel ) ;
incr ( exbufptr ) ;
while ( ( ( bracelevel > 0 ) && ( exbufptr < exbuflength ) ) ) {
if ( ( exbuf [ exbufptr ] == 125 ) )
decr ( bracelevel ) ;
else if ( ( exbuf [ exbufptr ] == 123 ) )
incr ( bracelevel ) ;
incr ( exbufptr ) ;
}
precedingwhite = false ;
}
break ;
case 125 :
{
decrbracelevel ( poplitvar ) ;
incr ( exbufptr ) ;
precedingwhite = false ;
}
break ;
default:
if ( ( lexclass [ exbuf [ exbufptr ] ] == 1 ) )
{
incr ( exbufptr ) ;
precedingwhite = true ;
}
else {
incr ( exbufptr ) ;
precedingwhite = false ;
}
break ;
}
checkbracelevel ( poplitvar ) ;
}
boolean vontokenfound () {
/* 10 */ register boolean Result; nmbracelevel = 0
;
Result = false ;
while ( ( namebfptr < namebfxptr ) ) if ( ( ( svbuffer [ namebfptr ] >= 65 )
&& ( svbuffer [ namebfptr ] <= 90 ) ) )
goto lab10 ;
else if ( ( ( svbuffer [ namebfptr ] >= 97 ) && ( svbuffer [ namebfptr ] <=
122 ) ) )
{
Result = true ;
goto lab10 ;
}
else if ( ( svbuffer [ namebfptr ] == 123 ) )
{
incr ( nmbracelevel ) ;
incr ( namebfptr ) ;
if ( ( ( namebfptr + 2 < namebfxptr ) && ( svbuffer [ namebfptr ] == 92 )
) )
{
incr ( namebfptr ) ;
namebfyptr = namebfptr ;
while ( ( ( namebfptr < namebfxptr ) && ( lexclass [ svbuffer [
namebfptr ] ] == 2 ) ) ) incr ( namebfptr ) ;
controlseqloc = strlookup ( svbuffer , namebfyptr , namebfptr -
namebfyptr , 14 , false ) ;
if ( ( hashfound ) )
{
switch ( ( ilkinfo [ controlseqloc ] ) )
{case 3 :
case 5 :
case 7 :
case 9 :
case 11 :
goto lab10 ;
break ;
case 0 :
case 1 :
case 2 :
case 4 :
case 6 :
case 8 :
case 10 :
case 12 :
{
Result = true ;
goto lab10 ;
}
break ;
default:
{
{
(void) ReverseFPuts( logfile , "Control-sequence hash error" ) ;
(void) FPrintFStdErr( "Control-sequence hash error" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
break ;
}
}
while ( ( ( namebfptr < namebfxptr ) && ( nmbracelevel > 0 ) ) ) {
if ( ( ( svbuffer [ namebfptr ] >= 65 ) && ( svbuffer [ namebfptr ] <=
90 ) ) )
goto lab10 ;
else if ( ( ( svbuffer [ namebfptr ] >= 97 ) && ( svbuffer [ namebfptr
] <= 122 ) ) )
{
Result = true ;
goto lab10 ;
}
else if ( ( svbuffer [ namebfptr ] == 125 ) )
decr ( nmbracelevel ) ;
else if ( ( svbuffer [ namebfptr ] == 123 ) )
incr ( nmbracelevel ) ;
incr ( namebfptr ) ;
}
goto lab10 ;
}
else while ( ( ( nmbracelevel > 0 ) && ( namebfptr < namebfxptr ) ) ) {
if ( ( svbuffer [ namebfptr ] == 125 ) )
decr ( nmbracelevel ) ;
else if ( ( svbuffer [ namebfptr ] == 123 ) )
incr ( nmbracelevel ) ;
incr ( namebfptr ) ;
}
}
else incr ( namebfptr ) ;
lab10: ;
return(Result) ;
}
void vonnameendsandlastna (void) {
/* 10 */ vonend = lastend - 1 ;
while ( ( vonend > vonstart ) ) {
namebfptr = nametok [ vonend - 1 ] ;
namebfxptr = nametok [ vonend ] ;
if ( ( vontokenfound () ) )
goto lab10 ;
decr ( vonend ) ;
}
lab10: ;
}
void skipstuffatspbracele (void) {
while ( ( ( spbracelevel > 1 ) && ( spptr < spend )
) ) {
if ( ( strpool [ spptr ] == 125 ) )
decr ( spbracelevel ) ;
else if ( ( strpool [ spptr ] == 123 ) )
incr ( spbracelevel ) ;
incr ( spptr ) ;
}
}
void bracelvlonelettersco (void) {
{
(void) ReverseFPuts( logfile , "The format string \"" ) ;
(void) FPrintFStdErr( "The format string \"" ) ;
}
printapoolstr ( poplit1 ) ;
{
{
(void) ReverseFPuts( logfile , "\" has an illegal brace-level-1 letter" ) ;
(void) FPrintFStdErr( "\" has an illegal brace-level-1 letter" ) ;
}
bstexwarnprint () ;
}
}
#ifdef STDC
boolean zenoughtextchars (bufpointer enoughchars )
#else
boolean zenoughtextchars ( enoughchars )
bufpointer enoughchars ;
#endif
{register boolean Result; numtextchars = 0 ;
exbufyptr = exbufxptr ;
while ( ( ( exbufyptr < exbufptr ) && ( numtextchars < enoughchars ) ) ) {
incr ( exbufyptr ) ;
if ( ( exbuf [ exbufyptr - 1 ] == 123 ) )
{
incr ( bracelevel ) ;
if ( ( ( bracelevel == 1 ) && ( exbufyptr < exbufptr ) ) )
if ( ( exbuf [ exbufyptr ] == 92 ) )
{
incr ( exbufyptr ) ;
while ( ( ( exbufyptr < exbufptr ) && ( bracelevel > 0 ) ) ) {
if ( ( exbuf [ exbufyptr ] == 125 ) )
decr ( bracelevel ) ;
else if ( ( exbuf [ exbufyptr ] == 123 ) )
incr ( bracelevel ) ;
incr ( exbufyptr ) ;
}
}
}
else if ( ( exbuf [ exbufyptr - 1 ] == 125 ) )
decr ( bracelevel ) ;
incr ( numtextchars ) ;
}
if ( ( numtextchars < enoughchars ) )
Result = false ;
else Result = true ;
return(Result) ;
}
void figureouttheformatte (void) {
/* 15 */ {
exbufptr = 0 ;
spbracelevel = 0 ;
spptr = strstart [ poplit1 ] ;
spend = strstart [ poplit1 + 1 ] ;
while ( ( spptr < spend ) ) if ( ( strpool [ spptr ] == 123 ) )
{
incr ( spbracelevel ) ;
incr ( spptr ) ;
{
spxptr1 = spptr ;
alphafound = false ;
doubleletter = false ;
endofgroup = false ;
tobewritten = true ;
while ( ( ( ! endofgroup ) && ( spptr < spend ) ) ) if ( ( lexclass [
strpool [ spptr ] ] == 2 ) )
{
incr ( spptr ) ;
{
if ( ( alphafound ) )
{
bracelvlonelettersco () ;
tobewritten = false ;
}
else {
switch ( ( strpool [ spptr - 1 ] ) )
{case 102 :
case 70 :
{
curtoken = firststart ;
lasttoken = firstend ;
if ( ( curtoken == lasttoken ) )
tobewritten = false ;
if ( ( ( strpool [ spptr ] == 102 ) || ( strpool [ spptr ]
== 70 ) ) )
doubleletter = true ;
}
break ;
case 118 :
case 86 :
{
curtoken = vonstart ;
lasttoken = vonend ;
if ( ( curtoken == lasttoken ) )
tobewritten = false ;
if ( ( ( strpool [ spptr ] == 118 ) || ( strpool [ spptr ]
== 86 ) ) )
doubleletter = true ;
}
break ;
case 108 :
case 76 :
{
curtoken = vonend ;
lasttoken = lastend ;
if ( ( curtoken == lasttoken ) )
tobewritten = false ;
if ( ( ( strpool [ spptr ] == 108 ) || ( strpool [ spptr ]
== 76 ) ) )
doubleletter = true ;
}
break ;
case 106 :
case 74 :
{
curtoken = lastend ;
lasttoken = jrend ;
if ( ( curtoken == lasttoken ) )
tobewritten = false ;
if ( ( ( strpool [ spptr ] == 106 ) || ( strpool [ spptr ]
== 74 ) ) )
doubleletter = true ;
}
break ;
default:
{
bracelvlonelettersco () ;
tobewritten = false ;
}
break ;
}
if ( ( doubleletter ) )
incr ( spptr ) ;
}
alphafound = true ;
}
}
else if ( ( strpool [ spptr ] == 125 ) )
{
decr ( spbracelevel ) ;
incr ( spptr ) ;
endofgroup = true ;
}
else if ( ( strpool [ spptr ] == 123 ) )
{
incr ( spbracelevel ) ;
incr ( spptr ) ;
skipstuffatspbracele () ;
}
else incr ( spptr ) ;
if ( ( ( endofgroup ) && ( tobewritten ) ) )
{
exbufxptr = exbufptr ;
spptr = spxptr1 ;
spbracelevel = 1 ;
while ( ( spbracelevel > 0 ) ) if ( ( ( lexclass [ strpool [ spptr ]
] == 2 ) && ( spbracelevel == 1 ) ) )
{
incr ( spptr ) ;
{
if ( ( doubleletter ) )
incr ( spptr ) ;
usedefault = true ;
spxptr2 = spptr ;
if ( ( strpool [ spptr ] == 123 ) )
{
usedefault = false ;
incr ( spbracelevel ) ;
incr ( spptr ) ;
spxptr1 = spptr ;
skipstuffatspbracele () ;
spxptr2 = spptr - 1 ;
}
while ( ( curtoken < lasttoken ) ) {
if ( ( doubleletter ) )
{
namebfptr = nametok [ curtoken ] ;
namebfxptr = nametok [ curtoken + 1 ] ;
if ( ( exbuflength + ( namebfxptr - namebfptr ) > bufsize )
)
bufferoverflow () ;
while ( ( namebfptr < namebfxptr ) ) {
{
exbuf [ exbufptr ] = svbuffer [ namebfptr ] ;
incr ( exbufptr ) ;
}
incr ( namebfptr ) ;
}
}
else {
namebfptr = nametok [ curtoken ] ;
namebfxptr = nametok [ curtoken + 1 ] ;
while ( ( namebfptr < namebfxptr ) ) {
if ( ( lexclass [ svbuffer [ namebfptr ] ] == 2 ) )
{
{
if ( ( exbufptr == bufsize ) )
bufferoverflow () ;
{
exbuf [ exbufptr ] = svbuffer [ namebfptr ] ;
incr ( exbufptr ) ;
}
}
goto lab15 ;
}
else if ( ( ( svbuffer [ namebfptr ] == 123 ) && (
namebfptr + 1 < namebfxptr ) ) )
if ( ( svbuffer [ namebfptr + 1 ] == 92 ) )
{
if ( ( exbufptr + 2 > bufsize ) )
bufferoverflow () ;
{
exbuf [ exbufptr ] = 123 ;
incr ( exbufptr ) ;
}
{
exbuf [ exbufptr ] = 92 ;
incr ( exbufptr ) ;
}
namebfptr = namebfptr + 2 ;
nmbracelevel = 1 ;
while ( ( ( namebfptr < namebfxptr ) && ( nmbracelevel >
0 ) ) ) {
if ( ( svbuffer [ namebfptr ] == 125 ) )
decr ( nmbracelevel ) ;
else if ( ( svbuffer [ namebfptr ] == 123 ) )
incr ( nmbracelevel ) ;
{
if ( ( exbufptr == bufsize ) )
bufferoverflow () ;
{
exbuf [ exbufptr ] = svbuffer [ namebfptr ] ;
incr ( exbufptr ) ;
}
}
incr ( namebfptr ) ;
}
goto lab15 ;
}
incr ( namebfptr ) ;
}
lab15: ;
}
incr ( curtoken ) ;
if ( ( curtoken < lasttoken ) )
{
if ( ( usedefault ) )
{
if ( ( ! doubleletter ) )
{
if ( ( exbufptr == bufsize ) )
bufferoverflow () ;
{
exbuf [ exbufptr ] = 46 ;
incr ( exbufptr ) ;
}
}
if ( ( lexclass [ namesepchar [ curtoken ] ] == 4 ) )
{
if ( ( exbufptr == bufsize ) )
bufferoverflow () ;
{
exbuf [ exbufptr ] = namesepchar [ curtoken ] ;
incr ( exbufptr ) ;
}
}
else if ( ( ( curtoken == lasttoken - 1 ) || ( !
enoughtextchars ( 3 ) ) ) )
{
if ( ( exbufptr == bufsize ) )
bufferoverflow () ;
{
exbuf [ exbufptr ] = 126 ;
incr ( exbufptr ) ;
}
}
else {
if ( ( exbufptr == bufsize ) )
bufferoverflow () ;
{
exbuf [ exbufptr ] = 32 ;
incr ( exbufptr ) ;
}
}
}
else {
if ( ( exbuflength + ( spxptr2 - spxptr1 ) > bufsize ) )
bufferoverflow () ;
spptr = spxptr1 ;
while ( ( spptr < spxptr2 ) ) {
{
exbuf [ exbufptr ] = strpool [ spptr ] ;
incr ( exbufptr ) ;
}
incr ( spptr ) ;
}
}
}
}
if ( ( ! usedefault ) )
spptr = spxptr2 + 1 ;
}
}
else if ( ( strpool [ spptr ] == 125 ) )
{
decr ( spbracelevel ) ;
incr ( spptr ) ;
if ( ( spbracelevel > 0 ) )
{
if ( ( exbufptr == bufsize ) )
bufferoverflow () ;
{
exbuf [ exbufptr ] = 125 ;
incr ( exbufptr ) ;
}
}
}
else if ( ( strpool [ spptr ] == 123 ) )
{
incr ( spbracelevel ) ;
incr ( spptr ) ;
{
if ( ( exbufptr == bufsize ) )
bufferoverflow () ;
{
exbuf [ exbufptr ] = 123 ;
incr ( exbufptr ) ;
}
}
}
else {
{
if ( ( exbufptr == bufsize ) )
bufferoverflow () ;
{
exbuf [ exbufptr ] = strpool [ spptr ] ;
incr ( exbufptr ) ;
}
}
incr ( spptr ) ;
}
if ( ( exbufptr > 0 ) )
if ( ( exbuf [ exbufptr - 1 ] == 126 ) )
{
decr ( exbufptr ) ;
if ( ( exbuf [ exbufptr - 1 ] == 126 ) )
;
else if ( ( ! enoughtextchars ( 3 ) ) )
incr ( exbufptr ) ;
else {
exbuf [ exbufptr ] = 32 ;
incr ( exbufptr ) ;
}
}
}
}
}
else if ( ( strpool [ spptr ] == 125 ) )
{
bracesunbalancedcomp ( poplit1 ) ;
incr ( spptr ) ;
}
else {
{
if ( ( exbufptr == bufsize ) )
bufferoverflow () ;
{
exbuf [ exbufptr ] = strpool [ spptr ] ;
incr ( exbufptr ) ;
}
}
incr ( spptr ) ;
}
if ( ( spbracelevel > 0 ) )
bracesunbalancedcomp ( poplit1 ) ;
exbuflength = exbufptr ;
}
}
void
#ifdef STDC
zpushlitstk (integer pushlt ,stktype pushtype )
#else
zpushlitstk ( pushlt , pushtype )
integer pushlt ;
stktype pushtype ;
#endif
{
#ifdef TRACE
litstkloc dumptr ;
#endif /* TRACE */
litstack [ litstkptr ] = pushlt ;
litstktype [ litstkptr ] = pushtype ;
;
#ifdef TRACE
{register integer for_end; dumptr = 0 ; for_end = litstkptr ; if ( dumptr
<= for_end) do
{
(void) ReverseFPuts( logfile , " " ) ;
}
while ( dumptr++ < for_end ) ; }
{
(void) ReverseFPuts( logfile , "Pushing " ) ;
}
switch ( ( litstktype [ litstkptr ] ) )
{case 0 :
{
(void) FPrintF( logfile , "%ld\r", (long)litstack [ litstkptr ] ) ;
}
break ;
case 1 :
{
{
(void) FPutC( '"' , logfile );
}
{
outpoolstr ( logfile , litstack [ litstkptr ] ) ;
}
{
(void) FPrintF( logfile , "%c\r", '"' ) ;
}
}
break ;
case 2 :
{
{
(void) FPutC( '`' , logfile );
}
{
outpoolstr ( logfile , hashtext [ litstack [ litstkptr ] ] ) ;
}
{
(void) FPrintF( logfile , "%c\r", '\'' ) ;
}
}
break ;
case 3 :
{
{
(void) ReverseFPuts( logfile , "missing field `" ) ;
}
{
outpoolstr ( logfile , litstack [ litstkptr ] ) ;
}
{
(void) FPrintF( logfile , "%c\r", '\'' ) ;
}
}
break ;
case 4 :
{
(void) FPrintF( logfile , "%s\r", "a bad literal--popped from an empty stack" ) ;
}
break ;
default:
unknwnliteralconfusi () ;
break ;
}
#endif /* TRACE */
if ( ( litstkptr == litstksize ) )
{
printoverflow () ;
{
(void) FPrintF( logfile , "%s%ld\r", "literal-stack size " , (long)litstksize ) ;
(void) FPrintFStdErr( "%s%ld\r", "literal-stack size " , (long)litstksize ) ;
}
longjmp(jmp9998,1) ;
}
incr ( litstkptr ) ;
}
void
#ifdef STDC
zpoplitstk (integer * poplit ,stktype * poptype )
#else
zpoplitstk ( poplit , poptype )
integer * poplit ;
stktype * poptype ;
#endif
{if ( ( litstkptr == 0 ) )
{
{
{
(void) ReverseFPuts( logfile , "You can't pop an empty literal stack" ) ;
(void) FPrintFStdErr( "You can't pop an empty literal stack" ) ;
}
bstexwarnprint () ;
}
* poptype = 4 ;
}
else {
decr ( litstkptr ) ;
* poplit = litstack [ litstkptr ] ;
* poptype = litstktype [ litstkptr ] ;
if ( ( *poptype == 1 ) )
if ( ( *poplit >= cmdstrptr ) )
{
if ( ( *poplit != strptr - 1 ) )
{
{
(void) ReverseFPuts( logfile , "Nontop top of string stack" ) ;
(void) FPrintFStdErr( "Nontop top of string stack" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
{
decr ( strptr ) ;
poolptr = strstart [ strptr ] ;
}
}
}
}
void
#ifdef STDC
zprintwrongstklit (integer stklt ,stktype stktp1 ,stktype stktp2 )
#else
zprintwrongstklit ( stklt , stktp1 , stktp2 )
integer stklt ;
stktype stktp1 , stktp2 ;
#endif
{if ( ( stktp1 != 4 ) )
{
printstklit ( stklt , stktp1 ) ;
switch ( ( stktp2 ) )
{case 0 :
{
(void) ReverseFPuts( logfile , ", not an integer," ) ;
(void) FPrintFStdErr( ", not an integer," ) ;
}
break ;
case 1 :
{
(void) ReverseFPuts( logfile , ", not a string," ) ;
(void) FPrintFStdErr( ", not a string," ) ;
}
break ;
case 2 :
{
(void) ReverseFPuts( logfile , ", not a function," ) ;
(void) FPrintFStdErr( ", not a function," ) ;
}
break ;
case 3 :
case 4 :
illeglliteralconfusi () ;
break ;
default:
unknwnliteralconfusi () ;
break ;
}
bstexwarnprint () ;
}
}
void poptopandprint (void) {
integer stklt ;
stktype stktp ;
poplitstk ( stklt , stktp ) ;
if ( ( stktp == 4 ) )
{
(void) FPrintF( logfile , "%s\r", "Empty literal" ) ;
(void) FPrintFStdErr( "%s\r", "Empty literal" ) ;
}
else printlit ( stklt , stktp ) ;
}
void popwholestack (void) {
while ( ( litstkptr > 0 ) ) poptopandprint () ;
}
void initcommandexecution (void) {
litstkptr = 0 ;
cmdstrptr = strptr ;
}
void checkcommandexecutio (void) {
if ( ( litstkptr != 0 ) )
{
{
(void) FPrintF( logfile , "%s%ld%s\r", "ptr=" , (long)litstkptr , ", stack=" ) ;
(void) FPrintFStdErr( "%s%ld%s\r", "ptr=" , (long)litstkptr , ", stack=" ) ;
}
popwholestack () ;
{
{
(void) ReverseFPuts( logfile , "---the literal stack isn't empty" ) ;
(void) FPrintFStdErr( "---the literal stack isn't empty" ) ;
}
bstexwarnprint () ;
}
}
if ( ( cmdstrptr != strptr ) )
{
;
#ifdef TRACE
{
(void) FPrintF( logfile , "%s%ld%s%ld\r", "Pointer is " , (long)strptr , " but should be " , (long)cmdstrptr ) ;
(void) FPrintFStdErr( "%s%ld%s%ld\r", "Pointer is " , (long)strptr , " but should be " , (long)cmdstrptr ) ;
}
#endif /* TRACE */
{
{
(void) ReverseFPuts( logfile , "Nonempty empty string stack" ) ;
(void) FPrintFStdErr( "Nonempty empty string stack" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
}
}
void addpoolbufandpush (void) {
{
if ( ( poolptr + exbuflength > poolsize ) )
pooloverflow () ;
}
exbufptr = 0 ;
while ( ( exbufptr < exbuflength ) ) {
{
strpool [ poolptr ] = exbuf [ exbufptr ] ;
incr ( poolptr ) ;
}
incr ( exbufptr ) ;
}
pushlitstk ( makestring () , 1 ) ;
}
void
#ifdef STDC
zaddbufpool (strnumber pstr )
#else
zaddbufpool ( pstr )
strnumber pstr ;
#endif
{pptr1 = strstart [ pstr ] ;
pptr2 = strstart [ pstr + 1 ] ;
if ( ( exbuflength + ( pptr2 - pptr1 ) > bufsize ) )
bufferoverflow () ;
exbufptr = exbuflength ;
while ( ( pptr1 < pptr2 ) ) {
{
exbuf [ exbufptr ] = strpool [ pptr1 ] ;
incr ( exbufptr ) ;
}
incr ( pptr1 ) ;
}
exbuflength = exbufptr ;
}
void
#ifdef STDC
zaddoutpool (strnumber pstr )
#else
zaddoutpool ( pstr )
strnumber pstr ;
#endif
{bufpointer breakptr ;
bufpointer endptr ;
pptr1 = strstart [ pstr ] ;
pptr2 = strstart [ pstr + 1 ] ;
if ( ( outbuflength + ( pptr2 - pptr1 ) > bufsize ) )
{
printoverflow () ;
{
(void) FPrintF( logfile , "%s%ld\r", "output buffer size " , (long)bufsize ) ;
(void) FPrintFStdErr( "%s%ld\r", "output buffer size " , (long)bufsize ) ;
}
longjmp(jmp9998,1) ;
}
outbufptr = outbuflength ;
while ( ( pptr1 < pptr2 ) ) {
outbuf [ outbufptr ] = strpool [ pptr1 ] ;
incr ( pptr1 ) ;
incr ( outbufptr ) ;
}
outbuflength = outbufptr ;
while ( ( outbuflength > maxprintline ) ) {
endptr = outbuflength ;
outbufptr = maxprintline ;
while ( ( ( lexclass [ outbuf [ outbufptr ] ] != 1 ) && ( outbufptr >=
minprintline ) ) ) decr ( outbufptr ) ;
if ( ( outbufptr == minprintline - 1 ) )
{
outbuf [ endptr ] = outbuf [ maxprintline - 1 ] ;
outbuf [ maxprintline - 1 ] = 37 ;
outbuflength = maxprintline ;
breakptr = outbuflength - 1 ;
outputbblline () ;
outbuf [ maxprintline - 1 ] = outbuf [ endptr ] ;
outbufptr = 0 ;
tmpptr = breakptr ;
while ( ( tmpptr < endptr ) ) {
outbuf [ outbufptr ] = outbuf [ tmpptr ] ;
incr ( outbufptr ) ;
incr ( tmpptr ) ;
}
outbuflength = endptr - breakptr ;
}
else {
outbuflength = outbufptr ;
breakptr = outbuflength + 1 ;
outputbblline () ;
outbuf [ 0 ] = 32 ;
outbuf [ 1 ] = 32 ;
outbufptr = 2 ;
tmpptr = breakptr ;
while ( ( tmpptr < endptr ) ) {
outbuf [ outbufptr ] = outbuf [ tmpptr ] ;
incr ( outbufptr ) ;
incr ( tmpptr ) ;
}
outbuflength = endptr - breakptr + 2 ;
}
}
}
void xequals (void) {
poplitstk ( poplit1 , poptyp1 ) ;
poplitstk ( poplit2 , poptyp2 ) ;
if ( ( poptyp1 != poptyp2 ) )
{
if ( ( ( poptyp1 != 4 ) && ( poptyp2 != 4 ) ) )
{
printstklit ( poplit1 , poptyp1 ) ;
{
(void) ReverseFPuts( logfile , ", " ) ;
(void) FPrintFStdErr( ", " ) ;
}
printstklit ( poplit2 , poptyp2 ) ;
printanewline () ;
{
{
(void) ReverseFPuts( logfile , "---they aren't the same literal types" ) ;
(void) FPrintFStdErr( "---they aren't the same literal types" ) ;
}
bstexwarnprint () ;
}
}
pushlitstk ( 0 , 0 ) ;
}
else if ( ( ( poptyp1 != 0 ) && ( poptyp1 != 1 ) ) )
{
if ( ( poptyp1 != 4 ) )
{
printstklit ( poplit1 , poptyp1 ) ;
{
{
(void) ReverseFPuts( logfile , ", not an integer or a string," ) ;
(void) FPrintFStdErr( ", not an integer or a string," ) ;
}
bstexwarnprint () ;
}
}
pushlitstk ( 0 , 0 ) ;
}
else if ( ( poptyp1 == 0 ) )
if ( ( poplit2 == poplit1 ) )
pushlitstk ( 1 , 0 ) ;
else pushlitstk ( 0 , 0 ) ;
else if ( ( streqstr ( poplit2 , poplit1 ) ) )
pushlitstk ( 1 , 0 ) ;
else pushlitstk ( 0 , 0 ) ;
}
void xgreaterthan (void) {
poplitstk ( poplit1 , poptyp1 ) ;
poplitstk ( poplit2 , poptyp2 ) ;
if ( ( poptyp1 != 0 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 0 ) ;
pushlitstk ( 0 , 0 ) ;
}
else if ( ( poptyp2 != 0 ) )
{
printwrongstklit ( poplit2 , poptyp2 , 0 ) ;
pushlitstk ( 0 , 0 ) ;
}
else if ( ( poplit2 > poplit1 ) )
pushlitstk ( 1 , 0 ) ;
else pushlitstk ( 0 , 0 ) ;
}
void xlessthan (void) {
poplitstk ( poplit1 , poptyp1 ) ;
poplitstk ( poplit2 , poptyp2 ) ;
if ( ( poptyp1 != 0 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 0 ) ;
pushlitstk ( 0 , 0 ) ;
}
else if ( ( poptyp2 != 0 ) )
{
printwrongstklit ( poplit2 , poptyp2 , 0 ) ;
pushlitstk ( 0 , 0 ) ;
}
else if ( ( poplit2 < poplit1 ) )
pushlitstk ( 1 , 0 ) ;
else pushlitstk ( 0 , 0 ) ;
}
void xplus (void) {
poplitstk ( poplit1 , poptyp1 ) ;
poplitstk ( poplit2 , poptyp2 ) ;
if ( ( poptyp1 != 0 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 0 ) ;
pushlitstk ( 0 , 0 ) ;
}
else if ( ( poptyp2 != 0 ) )
{
printwrongstklit ( poplit2 , poptyp2 , 0 ) ;
pushlitstk ( 0 , 0 ) ;
}
else pushlitstk ( poplit2 + poplit1 , 0 ) ;
}
void xminus (void) {
poplitstk ( poplit1 , poptyp1 ) ;
poplitstk ( poplit2 , poptyp2 ) ;
if ( ( poptyp1 != 0 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 0 ) ;
pushlitstk ( 0 , 0 ) ;
}
else if ( ( poptyp2 != 0 ) )
{
printwrongstklit ( poplit2 , poptyp2 , 0 ) ;
pushlitstk ( 0 , 0 ) ;
}
else pushlitstk ( poplit2 - poplit1 , 0 ) ;
}
void xconcatenate (void) {
poplitstk ( poplit1 , poptyp1 ) ;
poplitstk ( poplit2 , poptyp2 ) ;
if ( ( poptyp1 != 1 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 1 ) ;
pushlitstk ( snull , 1 ) ;
}
else if ( ( poptyp2 != 1 ) )
{
printwrongstklit ( poplit2 , poptyp2 , 1 ) ;
pushlitstk ( snull , 1 ) ;
}
else {
if ( ( poplit2 >= cmdstrptr ) )
if ( ( poplit1 >= cmdstrptr ) )
{
strstart [ poplit1 ] = strstart [ poplit1 + 1 ] ;
{
incr ( strptr ) ;
poolptr = strstart [ strptr ] ;
}
incr ( litstkptr ) ;
}
else if ( ( ( strstart [ poplit2 + 1 ] - strstart [ poplit2 ] ) == 0 ) )
pushlitstk ( poplit1 , 1 ) ;
else {
poolptr = strstart [ poplit2 + 1 ] ;
{
if ( ( poolptr + ( strstart [ poplit1 + 1 ] - strstart [ poplit1 ] ) >
poolsize ) )
pooloverflow () ;
}
spptr = strstart [ poplit1 ] ;
spend = strstart [ poplit1 + 1 ] ;
while ( ( spptr < spend ) ) {
{
strpool [ poolptr ] = strpool [ spptr ] ;
incr ( poolptr ) ;
}
incr ( spptr ) ;
}
pushlitstk ( makestring () , 1 ) ;
}
else {
if ( ( poplit1 >= cmdstrptr ) )
if ( ( ( strstart [ poplit2 + 1 ] - strstart [ poplit2 ] ) == 0 ) )
{
{
incr ( strptr ) ;
poolptr = strstart [ strptr ] ;
}
litstack [ litstkptr ] = poplit1 ;
incr ( litstkptr ) ;
}
else if ( ( ( strstart [ poplit1 + 1 ] - strstart [ poplit1 ] ) == 0 ) )
incr ( litstkptr ) ;
else {
splength = ( strstart [ poplit1 + 1 ] - strstart [ poplit1 ] ) ;
sp2length = ( strstart [ poplit2 + 1 ] - strstart [ poplit2 ] ) ;
{
if ( ( poolptr + splength + sp2length > poolsize ) )
pooloverflow () ;
}
spptr = strstart [ poplit1 + 1 ] ;
spend = strstart [ poplit1 ] ;
spxptr1 = spptr + sp2length ;
while ( ( spptr > spend ) ) {
decr ( spptr ) ;
decr ( spxptr1 ) ;
strpool [ spxptr1 ] = strpool [ spptr ] ;
}
spptr = strstart [ poplit2 ] ;
spend = strstart [ poplit2 + 1 ] ;
while ( ( spptr < spend ) ) {
{
strpool [ poolptr ] = strpool [ spptr ] ;
incr ( poolptr ) ;
}
incr ( spptr ) ;
}
poolptr = poolptr + splength ;
pushlitstk ( makestring () , 1 ) ;
}
else {
if ( ( ( strstart [ poplit1 + 1 ] - strstart [ poplit1 ] ) == 0 ) )
incr ( litstkptr ) ;
else if ( ( ( strstart [ poplit2 + 1 ] - strstart [ poplit2 ] ) == 0 )
)
pushlitstk ( poplit1 , 1 ) ;
else {
{
if ( ( poolptr + ( strstart [ poplit1 + 1 ] - strstart [ poplit1 ]
) + ( strstart [ poplit2 + 1 ] - strstart [ poplit2 ] ) > poolsize
) )
pooloverflow () ;
}
spptr = strstart [ poplit2 ] ;
spend = strstart [ poplit2 + 1 ] ;
while ( ( spptr < spend ) ) {
{
strpool [ poolptr ] = strpool [ spptr ] ;
incr ( poolptr ) ;
}
incr ( spptr ) ;
}
spptr = strstart [ poplit1 ] ;
spend = strstart [ poplit1 + 1 ] ;
while ( ( spptr < spend ) ) {
{
strpool [ poolptr ] = strpool [ spptr ] ;
incr ( poolptr ) ;
}
incr ( spptr ) ;
}
pushlitstk ( makestring () , 1 ) ;
}
}
}
}
}
void xgets (void) {
poplitstk ( poplit1 , poptyp1 ) ;
poplitstk ( poplit2 , poptyp2 ) ;
if ( ( poptyp1 != 2 ) )
printwrongstklit ( poplit1 , poptyp1 , 2 ) ;
else if ( ( ( ! messwithentries ) && ( ( fntype [ poplit1 ] == 6 ) || (
fntype [ poplit1 ] == 5 ) ) ) )
bstcantmesswithentri () ;
else switch ( ( fntype [ poplit1 ] ) )
{case 5 :
if ( ( poptyp2 != 0 ) )
printwrongstklit ( poplit2 , poptyp2 , 0 ) ;
else entryints [ citeptr * numentints + ilkinfo [ poplit1 ] ] = poplit2 ;
break ;
case 6 :
{
if ( ( poptyp2 != 1 ) )
printwrongstklit ( poplit2 , poptyp2 , 1 ) ;
else {
strentptr = citeptr * numentstrs + ilkinfo [ poplit1 ] ;
entchrptr = 0 ;
spptr = strstart [ poplit2 ] ;
spxptr1 = strstart [ poplit2 + 1 ] ;
if ( ( spxptr1 - spptr > entstrsize ) )
{
{
bst1printstringsizee () ;
{
(void) FPrintF( logfile , "%ld%s", (long)entstrsize , ", the entry" ) ;
(void) FPrintFStdErr( "%ld%s", (long)entstrsize , ", the entry" ) ;
}
bst2printstringsizee () ;
}
spxptr1 = spptr + entstrsize ;
}
while ( ( spptr < spxptr1 ) ) {
entrystrs [ strentptr ] [ entchrptr ] = strpool [ spptr ] ;
incr ( entchrptr ) ;
incr ( spptr ) ;
}
entrystrs [ strentptr ] [ entchrptr ] = 127 ;
}
}
break ;
case 7 :
if ( ( poptyp2 != 0 ) )
printwrongstklit ( poplit2 , poptyp2 , 0 ) ;
else ilkinfo [ poplit1 ] = poplit2 ;
break ;
case 8 :
{
if ( ( poptyp2 != 1 ) )
printwrongstklit ( poplit2 , poptyp2 , 1 ) ;
else {
strglbptr = ilkinfo [ poplit1 ] ;
if ( ( poplit2 < cmdstrptr ) )
glbstrptr [ strglbptr ] = poplit2 ;
else {
glbstrptr [ strglbptr ] = 0 ;
globchrptr = 0 ;
spptr = strstart [ poplit2 ] ;
spend = strstart [ poplit2 + 1 ] ;
if ( ( spend - spptr > globstrsize ) )
{
{
bst1printstringsizee () ;
{
(void) FPrintF( logfile , "%ld%s", (long)globstrsize , ", the global" ) ;
(void) FPrintFStdErr( "%ld%s", (long)globstrsize , ", the global" ) ;
}
bst2printstringsizee () ;
}
spend = spptr + globstrsize ;
}
while ( ( spptr < spend ) ) {
globalstrs [ strglbptr ] [ globchrptr ] = strpool [ spptr ] ;
incr ( globchrptr ) ;
incr ( spptr ) ;
}
glbstrend [ strglbptr ] = globchrptr ;
}
}
}
break ;
default:
{
{
(void) ReverseFPuts( logfile , "You can't assign to type " ) ;
(void) FPrintFStdErr( "You can't assign to type " ) ;
}
printfnclass ( poplit1 ) ;
{
{
(void) ReverseFPuts( logfile , ", a nonvariable function class" ) ;
(void) FPrintFStdErr( ", a nonvariable function class" ) ;
}
bstexwarnprint () ;
}
}
break ;
}
}
void xaddperiod (void) {
/* 15 */ poplitstk ( poplit1 , poptyp1 ) ;
if ( ( poptyp1 != 1 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 1 ) ;
pushlitstk ( snull , 1 ) ;
}
else if ( ( ( strstart [ poplit1 + 1 ] - strstart [ poplit1 ] ) == 0 ) )
pushlitstk ( snull , 1 ) ;
else {
spptr = strstart [ poplit1 + 1 ] ;
spend = strstart [ poplit1 ] ;
while ( ( spptr > spend ) ) {
decr ( spptr ) ;
if ( ( strpool [ spptr ] != 125 ) )
goto lab15 ;
}
lab15: switch ( ( strpool [ spptr ] ) )
{case 46 :
case 63 :
case 33 :
{
if ( ( litstack [ litstkptr ] >= cmdstrptr ) )
{
incr ( strptr ) ;
poolptr = strstart [ strptr ] ;
}
incr ( litstkptr ) ;
}
break ;
default:
{
if ( ( poplit1 < cmdstrptr ) )
{
{
if ( ( poolptr + ( strstart [ poplit1 + 1 ] - strstart [ poplit1 ]
) + 1 > poolsize ) )
pooloverflow () ;
}
spptr = strstart [ poplit1 ] ;
spend = strstart [ poplit1 + 1 ] ;
while ( ( spptr < spend ) ) {
{
strpool [ poolptr ] = strpool [ spptr ] ;
incr ( poolptr ) ;
}
incr ( spptr ) ;
}
}
else {
poolptr = strstart [ poplit1 + 1 ] ;
{
if ( ( poolptr + 1 > poolsize ) )
pooloverflow () ;
}
}
{
strpool [ poolptr ] = 46 ;
incr ( poolptr ) ;
}
pushlitstk ( makestring () , 1 ) ;
}
break ;
}
}
}
void xchangecase (void) {
/* 21 */ poplitstk ( poplit1 , poptyp1 ) ;
poplitstk ( poplit2 , poptyp2 ) ;
if ( ( poptyp1 != 1 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 1 ) ;
pushlitstk ( snull , 1 ) ;
}
else if ( ( poptyp2 != 1 ) )
{
printwrongstklit ( poplit2 , poptyp2 , 1 ) ;
pushlitstk ( snull , 1 ) ;
}
else {
{
switch ( ( strpool [ strstart [ poplit1 ] ] ) )
{case 116 :
case 84 :
conversiontype = 0 ;
break ;
case 108 :
case 76 :
conversiontype = 1 ;
break ;
case 117 :
case 85 :
conversiontype = 2 ;
break ;
default:
conversiontype = 3 ;
break ;
}
if ( ( ( ( strstart [ poplit1 + 1 ] - strstart [ poplit1 ] ) != 1 ) || (
conversiontype == 3 ) ) )
{
conversiontype = 3 ;
printapoolstr ( poplit1 ) ;
{
{
(void) ReverseFPuts( logfile , " is an illegal case-conversion string" ) ;
(void) FPrintFStdErr( " is an illegal case-conversion string" ) ;
}
bstexwarnprint () ;
}
}
}
exbuflength = 0 ;
addbufpool ( poplit2 ) ;
{
bracelevel = 0 ;
exbufptr = 0 ;
while ( ( exbufptr < exbuflength ) ) {
if ( ( exbuf [ exbufptr ] == 123 ) )
{
incr ( bracelevel ) ;
if ( ( bracelevel != 1 ) )
goto lab21 ;
if ( ( exbufptr + 4 > exbuflength ) )
goto lab21 ;
else if ( ( exbuf [ exbufptr + 1 ] != 92 ) )
goto lab21 ;
if ( ( conversiontype == 0 ) )
if ( ( exbufptr == 0 ) )
goto lab21 ;
else if ( ( ( prevcolon ) && ( lexclass [ exbuf [ exbufptr - 1 ] ]
== 1 ) ) )
goto lab21 ;
{
incr ( exbufptr ) ;
while ( ( ( exbufptr < exbuflength ) && ( bracelevel > 0 ) ) ) {
incr ( exbufptr ) ;
exbufxptr = exbufptr ;
while ( ( ( exbufptr < exbuflength ) && ( lexclass [ exbuf [
exbufptr ] ] == 2 ) ) ) incr ( exbufptr ) ;
controlseqloc = strlookup ( exbuf , exbufxptr , exbufptr -
exbufxptr , 14 , false ) ;
if ( ( hashfound ) )
{
switch ( ( conversiontype ) )
{case 0 :
case 1 :
switch ( ( ilkinfo [ controlseqloc ] ) )
{case 11 :
case 9 :
case 3 :
case 5 :
case 7 :
lowercase ( exbuf , exbufxptr , exbufptr - exbufxptr ) ;
break ;
default:
;
break ;
}
break ;
case 2 :
switch ( ( ilkinfo [ controlseqloc ] ) )
{case 10 :
case 8 :
case 2 :
case 4 :
case 6 :
uppercase ( exbuf , exbufxptr , exbufptr - exbufxptr ) ;
break ;
case 0 :
case 1 :
case 12 :
{
uppercase ( exbuf , exbufxptr , exbufptr - exbufxptr ) ;
while ( ( exbufxptr < exbufptr ) ) {
exbuf [ exbufxptr - 1 ] = exbuf [ exbufxptr ] ;
incr ( exbufxptr ) ;
}
decr ( exbufxptr ) ;
while ( ( ( exbufptr < exbuflength ) && ( lexclass [
exbuf [ exbufptr ] ] == 1 ) ) ) incr ( exbufptr ) ;
tmpptr = exbufptr ;
while ( ( tmpptr < exbuflength ) ) {
exbuf [ tmpptr - ( exbufptr - exbufxptr ) ] = exbuf [
tmpptr ] ;
incr ( tmpptr ) ;
}
exbuflength = tmpptr - ( exbufptr - exbufxptr ) ;
exbufptr = exbufxptr ;
}
break ;
default:
;
break ;
}
break ;
case 3 :
;
break ;
default:
caseconversionconfus () ;
break ;
}
}
exbufxptr = exbufptr ;
while ( ( ( exbufptr < exbuflength ) && ( bracelevel > 0 ) && (
exbuf [ exbufptr ] != 92 ) ) ) {
if ( ( exbuf [ exbufptr ] == 125 ) )
decr ( bracelevel ) ;
else if ( ( exbuf [ exbufptr ] == 123 ) )
incr ( bracelevel ) ;
incr ( exbufptr ) ;
}
{
switch ( ( conversiontype ) )
{case 0 :
case 1 :
lowercase ( exbuf , exbufxptr , exbufptr - exbufxptr ) ;
break ;
case 2 :
uppercase ( exbuf , exbufxptr , exbufptr - exbufxptr ) ;
break ;
case 3 :
;
break ;
default:
caseconversionconfus () ;
break ;
}
}
}
decr ( exbufptr ) ;
}
lab21: prevcolon = false ;
}
else if ( ( exbuf [ exbufptr ] == 125 ) )
{
decrbracelevel ( poplit2 ) ;
prevcolon = false ;
}
else if ( ( bracelevel == 0 ) )
{
switch ( ( conversiontype ) )
{case 0 :
{
if ( ( exbufptr == 0 ) )
;
else if ( ( ( prevcolon ) && ( lexclass [ exbuf [ exbufptr - 1 ]
] == 1 ) ) )
;
else lowercase ( exbuf , exbufptr , 1 ) ;
if ( ( exbuf [ exbufptr ] == 58 ) )
prevcolon = true ;
else if ( ( lexclass [ exbuf [ exbufptr ] ] != 1 ) )
prevcolon = false ;
}
break ;
case 1 :
lowercase ( exbuf , exbufptr , 1 ) ;
break ;
case 2 :
uppercase ( exbuf , exbufptr , 1 ) ;
break ;
case 3 :
;
break ;
default:
caseconversionconfus () ;
break ;
}
}
incr ( exbufptr ) ;
}
checkbracelevel ( poplit2 ) ;
}
addpoolbufandpush () ;
}
}
void xchrtoint (void) {
poplitstk ( poplit1 , poptyp1 ) ;
if ( ( poptyp1 != 1 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 1 ) ;
pushlitstk ( 0 , 0 ) ;
}
else if ( ( ( strstart [ poplit1 + 1 ] - strstart [ poplit1 ] ) != 1 ) )
{
{
(void) FPutC( '"' , logfile );
(void) FPutC( '"' );
}
printapoolstr ( poplit1 ) ;
{
{
(void) ReverseFPuts( logfile , "\" isn't a single character" ) ;
(void) FPrintFStdErr( "\" isn't a single character" ) ;
}
bstexwarnprint () ;
}
pushlitstk ( 0 , 0 ) ;
}
else pushlitstk ( strpool [ strstart [ poplit1 ] ] , 0 ) ;
}
void xcite (void) {
if ( ( ! messwithentries ) )
bstcantmesswithentri () ;
else pushlitstk ( citelist [ citeptr ] , 1 ) ;
}
void xduplicate (void) {
poplitstk ( poplit1 , poptyp1 ) ;
if ( ( poptyp1 != 1 ) )
{
pushlitstk ( poplit1 , poptyp1 ) ;
pushlitstk ( poplit1 , poptyp1 ) ;
}
else {
{
if ( ( litstack [ litstkptr ] >= cmdstrptr ) )
{
incr ( strptr ) ;
poolptr = strstart [ strptr ] ;
}
incr ( litstkptr ) ;
}
if ( ( poplit1 < cmdstrptr ) )
pushlitstk ( poplit1 , poptyp1 ) ;
else {
{
if ( ( poolptr + ( strstart [ poplit1 + 1 ] - strstart [ poplit1 ] ) >
poolsize ) )
pooloverflow () ;
}
spptr = strstart [ poplit1 ] ;
spend = strstart [ poplit1 + 1 ] ;
while ( ( spptr < spend ) ) {
{
strpool [ poolptr ] = strpool [ spptr ] ;
incr ( poolptr ) ;
}
incr ( spptr ) ;
}
pushlitstk ( makestring () , 1 ) ;
}
}
}
void xempty (void) {
/* 10 */ poplitstk ( poplit1 , poptyp1 ) ;
switch ( ( poptyp1 ) )
{case 1 :
{
spptr = strstart [ poplit1 ] ;
spend = strstart [ poplit1 + 1 ] ;
while ( ( spptr < spend ) ) {
if ( ( lexclass [ strpool [ spptr ] ] != 1 ) )
{
pushlitstk ( 0 , 0 ) ;
goto lab10 ;
}
incr ( spptr ) ;
}
pushlitstk ( 1 , 0 ) ;
}
break ;
case 3 :
pushlitstk ( 1 , 0 ) ;
break ;
case 4 :
pushlitstk ( 0 , 0 ) ;
break ;
default:
{
printstklit ( poplit1 , poptyp1 ) ;
{
{
(void) ReverseFPuts( logfile , ", not a string or missing field," ) ;
(void) FPrintFStdErr( ", not a string or missing field," ) ;
}
bstexwarnprint () ;
}
pushlitstk ( 0 , 0 ) ;
}
break ;
}
lab10: ;
}
void xformatname (void) {
/* 16 17 52 */ poplitstk ( poplit1 , poptyp1 ) ;
poplitstk ( poplit2 , poptyp2 ) ;
poplitstk ( poplit3 , poptyp3 ) ;
if ( ( poptyp1 != 1 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 1 ) ;
pushlitstk ( snull , 1 ) ;
}
else if ( ( poptyp2 != 0 ) )
{
printwrongstklit ( poplit2 , poptyp2 , 0 ) ;
pushlitstk ( snull , 1 ) ;
}
else if ( ( poptyp3 != 1 ) )
{
printwrongstklit ( poplit3 , poptyp3 , 1 ) ;
pushlitstk ( snull , 1 ) ;
}
else {
exbuflength = 0 ;
addbufpool ( poplit3 ) ;
{
exbufptr = 0 ;
numnames = 0 ;
while ( ( ( numnames < poplit2 ) && ( exbufptr < exbuflength ) ) ) {
incr ( numnames ) ;
exbufxptr = exbufptr ;
namescanforand ( poplit3 ) ;
}
if ( ( exbufptr < exbuflength ) )
exbufptr = exbufptr - 4 ;
if ( ( numnames < poplit2 ) )
{
if ( ( poplit2 == 1 ) )
{
(void) ReverseFPuts( logfile , "There is no name in \"" ) ;
(void) FPrintFStdErr( "There is no name in \"" ) ;
}
else {
(void) FPrintF( logfile , "%s%ld%s", "There aren't " , (long)poplit2 , " names in \"" ) ;
(void) FPrintFStdErr( "%s%ld%s", "There aren't " , (long)poplit2 , " names in \"" ) ;
}
printapoolstr ( poplit3 ) ;
{
{
(void) FPutC( '"' , logfile );
(void) FPutC( '"' );
}
bstexwarnprint () ;
}
}
}
{
{
while ( ( ( exbufxptr < exbufptr ) && ( lexclass [ exbuf [ exbufptr ]
] == 1 ) && ( lexclass [ exbuf [ exbufptr ] ] == 4 ) ) ) incr (
exbufxptr ) ;
while ( ( exbufptr > exbufxptr ) ) switch ( ( lexclass [ exbuf [
exbufptr - 1 ] ] ) )
{case 1 :
case 4 :
decr ( exbufptr ) ;
break ;
default:
if ( ( exbuf [ exbufptr - 1 ] == 44 ) )
{
{
(void) FPrintF( logfile , "%s%ld%s", "Name " , (long)poplit2 , " in \"" ) ;
(void) FPrintFStdErr( "%s%ld%s", "Name " , (long)poplit2 , " in \"" ) ;
}
printapoolstr ( poplit3 ) ;
{
(void) ReverseFPuts( logfile , "\" has a comma at the end" ) ;
(void) FPrintFStdErr( "\" has a comma at the end" ) ;
}
bstexwarnprint () ;
decr ( exbufptr ) ;
}
else goto lab16 ;
break ;
}
lab16: ;
}
namebfptr = 0 ;
numcommas = 0 ;
numtokens = 0 ;
tokenstarting = true ;
while ( ( exbufxptr < exbufptr ) ) switch ( ( exbuf [ exbufxptr ] ) )
{case 44 :
{
if ( ( numcommas == 2 ) )
{
{
(void) FPrintF( logfile , "%s%ld%s", "Too many commas in name " , (long)poplit2 , " of \"" ) ;
(void) FPrintFStdErr( "%s%ld%s", "Too many commas in name " , (long)poplit2 , " of \"" ) ;
}
printapoolstr ( poplit3 ) ;
{
(void) FPutC( '"' , logfile );
(void) FPutC( '"' );
}
bstexwarnprint () ;
}
else {
incr ( numcommas ) ;
if ( ( numcommas == 1 ) )
comma1 = numtokens ;
else comma2 = numtokens ;
namesepchar [ numtokens ] = 44 ;
}
incr ( exbufxptr ) ;
tokenstarting = true ;
}
break ;
case 123 :
{
incr ( bracelevel ) ;
if ( ( tokenstarting ) )
{
nametok [ numtokens ] = namebfptr ;
incr ( numtokens ) ;
}
svbuffer [ namebfptr ] = exbuf [ exbufxptr ] ;
incr ( namebfptr ) ;
incr ( exbufxptr ) ;
while ( ( ( bracelevel > 0 ) && ( exbufxptr < exbufptr ) ) ) {
if ( ( exbuf [ exbufxptr ] == 125 ) )
decr ( bracelevel ) ;
else if ( ( exbuf [ exbufxptr ] == 123 ) )
incr ( bracelevel ) ;
svbuffer [ namebfptr ] = exbuf [ exbufxptr ] ;
incr ( namebfptr ) ;
incr ( exbufxptr ) ;
}
tokenstarting = false ;
}
break ;
case 125 :
{
if ( ( tokenstarting ) )
{
nametok [ numtokens ] = namebfptr ;
incr ( numtokens ) ;
}
{
(void) FPrintF( logfile , "%s%ld%s", "Name " , (long)poplit2 , " of \"" ) ;
(void) FPrintFStdErr( "%s%ld%s", "Name " , (long)poplit2 , " of \"" ) ;
}
printapoolstr ( poplit3 ) ;
{
{
(void) ReverseFPuts( logfile , "\" isn't brace balanced" ) ;
(void) FPrintFStdErr( "\" isn't brace balanced" ) ;
}
bstexwarnprint () ;
}
incr ( exbufxptr ) ;
tokenstarting = false ;
}
break ;
default:
switch ( ( lexclass [ exbuf [ exbufxptr ] ] ) )
{case 1 :
{
if ( ( ! tokenstarting ) )
namesepchar [ numtokens ] = 32 ;
incr ( exbufxptr ) ;
tokenstarting = true ;
}
break ;
case 4 :
{
if ( ( ! tokenstarting ) )
namesepchar [ numtokens ] = exbuf [ exbufxptr ] ;
incr ( exbufxptr ) ;
tokenstarting = true ;
}
break ;
default:
{
if ( ( tokenstarting ) )
{
nametok [ numtokens ] = namebfptr ;
incr ( numtokens ) ;
}
svbuffer [ namebfptr ] = exbuf [ exbufxptr ] ;
incr ( namebfptr ) ;
incr ( exbufxptr ) ;
tokenstarting = false ;
}
break ;
}
break ;
}
nametok [ numtokens ] = namebfptr ;
}
{
if ( ( numcommas == 0 ) )
{
firststart = 0 ;
lastend = numtokens ;
jrend = lastend ;
{
vonstart = 0 ;
while ( ( vonstart < lastend - 1 ) ) {
namebfptr = nametok [ vonstart ] ;
namebfxptr = nametok [ vonstart + 1 ] ;
if ( ( vontokenfound () ) )
{
vonnameendsandlastna () ;
goto lab52 ;
}
incr ( vonstart ) ;
}
while ( ( vonstart > 0 ) ) {
if ( ( ( lexclass [ namesepchar [ vonstart ] ] != 4 ) || (
namesepchar [ vonstart ] == 126 ) ) )
goto lab17 ;
decr ( vonstart ) ;
}
lab17: vonend = vonstart ;
lab52: firstend = vonstart ;
}
}
else if ( ( numcommas == 1 ) )
{
vonstart = 0 ;
lastend = comma1 ;
jrend = lastend ;
firststart = jrend ;
firstend = numtokens ;
vonnameendsandlastna () ;
}
else if ( ( numcommas == 2 ) )
{
vonstart = 0 ;
lastend = comma1 ;
jrend = comma2 ;
firststart = jrend ;
firstend = numtokens ;
vonnameendsandlastna () ;
}
else {
{
(void) ReverseFPuts( logfile , "Illegal number of comma,s" ) ;
(void) FPrintFStdErr( "Illegal number of comma,s" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
}
exbuflength = 0 ;
addbufpool ( poplit1 ) ;
figureouttheformatte () ;
addpoolbufandpush () ;
}
}
void xinttochr (void) {
poplitstk ( poplit1 , poptyp1 ) ;
if ( ( poptyp1 != 0 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 0 ) ;
pushlitstk ( snull , 1 ) ;
}
else if ( ( ( poplit1 < 0 ) || ( poplit1 > 127 ) ) )
{
{
{
(void) FPrintF( logfile , "%ld%s", (long)poplit1 , " isn't valid ASCII" ) ;
(void) FPrintFStdErr( "%ld%s", (long)poplit1 , " isn't valid ASCII" ) ;
}
bstexwarnprint () ;
}
pushlitstk ( snull , 1 ) ;
}
else {
{
if ( ( poolptr + 1 > poolsize ) )
pooloverflow () ;
}
{
strpool [ poolptr ] = poplit1 ;
incr ( poolptr ) ;
}
pushlitstk ( makestring () , 1 ) ;
}
}
void xinttostr (void) {
poplitstk ( poplit1 , poptyp1 ) ;
if ( ( poptyp1 != 0 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 0 ) ;
pushlitstk ( snull , 1 ) ;
}
else {
inttoASCII ( poplit1 , exbuf , 0 , exbuflength ) ;
addpoolbufandpush () ;
}
}
void xmissing (void) {
poplitstk ( poplit1 , poptyp1 ) ;
if ( ( ! messwithentries ) )
bstcantmesswithentri () ;
else if ( ( ( poptyp1 != 1 ) && ( poptyp1 != 3 ) ) )
{
if ( ( poptyp1 != 4 ) )
{
printstklit ( poplit1 , poptyp1 ) ;
{
{
(void) ReverseFPuts( logfile , ", not a string or missing field," ) ;
(void) FPrintFStdErr( ", not a string or missing field," ) ;
}
bstexwarnprint () ;
}
}
pushlitstk ( 0 , 0 ) ;
}
else if ( ( poptyp1 == 3 ) )
pushlitstk ( 1 , 0 ) ;
else pushlitstk ( 0 , 0 ) ;
}
void xnumnames (void) {
poplitstk ( poplit1 , poptyp1 ) ;
if ( ( poptyp1 != 1 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 1 ) ;
pushlitstk ( 0 , 0 ) ;
}
else {
exbuflength = 0 ;
addbufpool ( poplit1 ) ;
{
exbufptr = 0 ;
numnames = 0 ;
while ( ( exbufptr < exbuflength ) ) {
namescanforand ( poplit1 ) ;
incr ( numnames ) ;
}
}
pushlitstk ( numnames , 0 ) ;
}
}
void xpreamble (void) {
exbuflength = 0 ;
preambleptr = 0 ;
while ( ( preambleptr < numpreamblestrings ) ) {
addbufpool ( spreamble [ preambleptr ] ) ;
incr ( preambleptr ) ;
}
addpoolbufandpush () ;
}
void xpurify (void) {
poplitstk ( poplit1 , poptyp1 ) ;
if ( ( poptyp1 != 1 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 1 ) ;
pushlitstk ( snull , 1 ) ;
}
else {
exbuflength = 0 ;
addbufpool ( poplit1 ) ;
{
bracelevel = 0 ;
exbufxptr = 0 ;
exbufptr = 0 ;
while ( ( exbufptr < exbuflength ) ) {
switch ( ( lexclass [ exbuf [ exbufptr ] ] ) )
{case 1 :
case 4 :
{
exbuf [ exbufxptr ] = 32 ;
incr ( exbufxptr ) ;
}
break ;
case 2 :
case 3 :
{
exbuf [ exbufxptr ] = exbuf [ exbufptr ] ;
incr ( exbufxptr ) ;
}
break ;
default:
if ( ( exbuf [ exbufptr ] == 123 ) )
{
incr ( bracelevel ) ;
if ( ( ( bracelevel == 1 ) && ( exbufptr + 1 < exbuflength ) ) )
if ( ( exbuf [ exbufptr + 1 ] == 92 ) )
{
incr ( exbufptr ) ;
while ( ( ( exbufptr < exbuflength ) && ( bracelevel > 0 ) ) ) {
incr ( exbufptr ) ;
exbufyptr = exbufptr ;
while ( ( ( exbufptr < exbuflength ) && ( lexclass [ exbuf [
exbufptr ] ] == 2 ) ) ) incr ( exbufptr ) ;
controlseqloc = strlookup ( exbuf , exbufyptr , exbufptr -
exbufyptr , 14 , false ) ;
if ( ( hashfound ) )
{
exbuf [ exbufxptr ] = exbuf [ exbufyptr ] ;
incr ( exbufxptr ) ;
switch ( ( ilkinfo [ controlseqloc ] ) )
{case 2 :
case 3 :
case 4 :
case 5 :
case 12 :
{
exbuf [ exbufxptr ] = exbuf [ exbufyptr + 1 ] ;
incr ( exbufxptr ) ;
}
break ;
default:
;
break ;
}
}
while ( ( ( exbufptr < exbuflength ) && ( bracelevel > 0 ) &&
( exbuf [ exbufptr ] != 92 ) ) ) {
switch ( ( lexclass [ exbuf [ exbufptr ] ] ) )
{case 2 :
case 3 :
{
exbuf [ exbufxptr ] = exbuf [ exbufptr ] ;
incr ( exbufxptr ) ;
}
break ;
default:
if ( ( exbuf [ exbufptr ] == 125 ) )
decr ( bracelevel ) ;
else if ( ( exbuf [ exbufptr ] == 123 ) )
incr ( bracelevel ) ;
break ;
}
incr ( exbufptr ) ;
}
}
decr ( exbufptr ) ;
}
}
else if ( ( exbuf [ exbufptr ] == 125 ) )
if ( ( bracelevel > 0 ) )
decr ( bracelevel ) ;
break ;
}
incr ( exbufptr ) ;
}
exbuflength = exbufxptr ;
}
addpoolbufandpush () ;
}
}
void xquote (void) {
{
if ( ( poolptr + 1 > poolsize ) )
pooloverflow () ;
}
{
strpool [ poolptr ] = 34 ;
incr ( poolptr ) ;
}
pushlitstk ( makestring () , 1 ) ;
}
void xsubstring (void) {
/* 10 */ poplitstk ( poplit1 , poptyp1 ) ;
poplitstk ( poplit2 , poptyp2 ) ;
poplitstk ( poplit3 , poptyp3 ) ;
if ( ( poptyp1 != 0 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 0 ) ;
pushlitstk ( snull , 1 ) ;
}
else if ( ( poptyp2 != 0 ) )
{
printwrongstklit ( poplit2 , poptyp2 , 0 ) ;
pushlitstk ( snull , 1 ) ;
}
else if ( ( poptyp3 != 1 ) )
{
printwrongstklit ( poplit3 , poptyp3 , 1 ) ;
pushlitstk ( snull , 1 ) ;
}
else {
splength = ( strstart [ poplit3 + 1 ] - strstart [ poplit3 ] ) ;
if ( ( poplit1 >= splength ) )
if ( ( ( poplit2 == 1 ) || ( poplit2 == -1 ) ) )
{
{
if ( ( litstack [ litstkptr ] >= cmdstrptr ) )
{
incr ( strptr ) ;
poolptr = strstart [ strptr ] ;
}
incr ( litstkptr ) ;
}
goto lab10 ;
}
if ( ( ( poplit1 <= 0 ) || ( poplit2 == 0 ) || ( poplit2 > splength ) || (
poplit2 < - (integer) splength ) ) )
{
pushlitstk ( snull , 1 ) ;
goto lab10 ;
}
else {
if ( ( poplit2 > 0 ) )
{
if ( ( poplit1 > splength - ( poplit2 - 1 ) ) )
poplit1 = splength - ( poplit2 - 1 ) ;
spptr = strstart [ poplit3 ] + ( poplit2 - 1 ) ;
spend = spptr + poplit1 ;
if ( ( poplit2 == 1 ) )
if ( ( poplit3 >= cmdstrptr ) )
{
strstart [ poplit3 + 1 ] = spend ;
{
incr ( strptr ) ;
poolptr = strstart [ strptr ] ;
}
incr ( litstkptr ) ;
goto lab10 ;
}
}
else {
poplit2 = - (integer) poplit2 ;
if ( ( poplit1 > splength - ( poplit2 - 1 ) ) )
poplit1 = splength - ( poplit2 - 1 ) ;
spend = strstart [ poplit3 + 1 ] - ( poplit2 - 1 ) ;
spptr = spend - poplit1 ;
}
while ( ( spptr < spend ) ) {
{
strpool [ poolptr ] = strpool [ spptr ] ;
incr ( poolptr ) ;
}
incr ( spptr ) ;
}
pushlitstk ( makestring () , 1 ) ;
}
}
lab10: ;
}
void xswap (void) {
poplitstk ( poplit1 , poptyp1 ) ;
poplitstk ( poplit2 , poptyp2 ) ;
if ( ( ( poptyp1 != 1 ) || ( poplit1 < cmdstrptr ) ) )
{
pushlitstk ( poplit1 , poptyp1 ) ;
if ( ( ( poptyp2 == 1 ) && ( poplit2 >= cmdstrptr ) ) )
{
incr ( strptr ) ;
poolptr = strstart [ strptr ] ;
}
pushlitstk ( poplit2 , poptyp2 ) ;
}
else if ( ( ( poptyp2 != 1 ) || ( poplit2 < cmdstrptr ) ) )
{
{
incr ( strptr ) ;
poolptr = strstart [ strptr ] ;
}
pushlitstk ( poplit1 , 1 ) ;
pushlitstk ( poplit2 , poptyp2 ) ;
}
else {
exbuflength = 0 ;
addbufpool ( poplit2 ) ;
spptr = strstart [ poplit1 ] ;
spend = strstart [ poplit1 + 1 ] ;
while ( ( spptr < spend ) ) {
{
strpool [ poolptr ] = strpool [ spptr ] ;
incr ( poolptr ) ;
}
incr ( spptr ) ;
}
pushlitstk ( makestring () , 1 ) ;
addpoolbufandpush () ;
}
}
void xtextlength (void) {
poplitstk ( poplit1 , poptyp1 ) ;
if ( ( poptyp1 != 1 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 1 ) ;
pushlitstk ( snull , 1 ) ;
}
else {
numtextchars = 0 ;
{
spptr = strstart [ poplit1 ] ;
spend = strstart [ poplit1 + 1 ] ;
spbracelevel = 0 ;
while ( ( spptr < spend ) ) {
incr ( spptr ) ;
if ( ( strpool [ spptr - 1 ] == 123 ) )
{
incr ( spbracelevel ) ;
if ( ( ( spbracelevel == 1 ) && ( spptr < spend ) ) )
if ( ( strpool [ spptr ] == 92 ) )
{
incr ( spptr ) ;
while ( ( ( spptr < spend ) && ( spbracelevel > 0 ) ) ) {
if ( ( strpool [ spptr ] == 125 ) )
decr ( spbracelevel ) ;
else if ( ( strpool [ spptr ] == 123 ) )
incr ( spbracelevel ) ;
incr ( spptr ) ;
}
incr ( numtextchars ) ;
}
}
else if ( ( strpool [ spptr - 1 ] == 125 ) )
{
if ( ( spbracelevel > 0 ) )
decr ( spbracelevel ) ;
}
else incr ( numtextchars ) ;
}
}
pushlitstk ( numtextchars , 0 ) ;
}
}
void xtextprefix (void) {
/* 10 */ poplitstk ( poplit1 , poptyp1 ) ;
poplitstk ( poplit2 , poptyp2 ) ;
if ( ( poptyp1 != 0 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 0 ) ;
pushlitstk ( snull , 1 ) ;
}
else if ( ( poptyp2 != 1 ) )
{
printwrongstklit ( poplit2 , poptyp2 , 1 ) ;
pushlitstk ( snull , 1 ) ;
}
else if ( ( poplit1 <= 0 ) )
{
pushlitstk ( snull , 1 ) ;
goto lab10 ;
}
else {
spptr = strstart [ poplit2 ] ;
spend = strstart [ poplit2 + 1 ] ;
{
numtextchars = 0 ;
spbracelevel = 0 ;
spxptr1 = spptr ;
while ( ( ( spxptr1 < spend ) && ( numtextchars < poplit1 ) ) ) {
incr ( spxptr1 ) ;
if ( ( strpool [ spxptr1 - 1 ] == 123 ) )
{
incr ( spbracelevel ) ;
if ( ( ( spbracelevel == 1 ) && ( spxptr1 < spend ) ) )
if ( ( strpool [ spxptr1 ] == 92 ) )
{
incr ( spxptr1 ) ;
while ( ( ( spxptr1 < spend ) && ( spbracelevel > 0 ) ) ) {
if ( ( strpool [ spxptr1 ] == 125 ) )
decr ( spbracelevel ) ;
else if ( ( strpool [ spxptr1 ] == 123 ) )
incr ( spbracelevel ) ;
incr ( spxptr1 ) ;
}
incr ( numtextchars ) ;
}
}
else if ( ( strpool [ spxptr1 - 1 ] == 125 ) )
{
if ( ( spbracelevel > 0 ) )
decr ( spbracelevel ) ;
}
else incr ( numtextchars ) ;
}
spend = spxptr1 ;
}
if ( ( poplit2 >= cmdstrptr ) )
poolptr = spend ;
else while ( ( spptr < spend ) ) {
{
strpool [ poolptr ] = strpool [ spptr ] ;
incr ( poolptr ) ;
}
incr ( spptr ) ;
}
while ( ( spbracelevel > 0 ) ) {
{
strpool [ poolptr ] = 125 ;
incr ( poolptr ) ;
}
decr ( spbracelevel ) ;
}
pushlitstk ( makestring () , 1 ) ;
}
lab10: ;
}
void xtype (void) {
if ( ( ! messwithentries ) )
bstcantmesswithentri () ;
else if ( ( ( typelist [ citeptr ] == 5001 ) || ( typelist [ citeptr ] == 0
) ) )
pushlitstk ( snull , 1 ) ;
else pushlitstk ( hashtext [ typelist [ citeptr ] ] , 1 ) ;
}
void xwarning (void) {
poplitstk ( poplit1 , poptyp1 ) ;
if ( ( poptyp1 != 1 ) )
printwrongstklit ( poplit1 , poptyp1 , 1 ) ;
else {
{
(void) ReverseFPuts( logfile , "Warning--" ) ;
(void) FPrintFStdErr( "Warning--" ) ;
}
printlit ( poplit1 , poptyp1 ) ;
markwarning () ;
}
}
void xwidth (void) {
poplitstk ( poplit1 , poptyp1 ) ;
if ( ( poptyp1 != 1 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 1 ) ;
pushlitstk ( 0 , 0 ) ;
}
else {
exbuflength = 0 ;
addbufpool ( poplit1 ) ;
bibstringwidth = 0 ;
{
bracelevel = 0 ;
exbufptr = 0 ;
while ( ( exbufptr < exbuflength ) ) {
if ( ( exbuf [ exbufptr ] == 123 ) )
{
incr ( bracelevel ) ;
if ( ( ( bracelevel == 1 ) && ( exbufptr + 1 < exbuflength ) ) )
if ( ( exbuf [ exbufptr + 1 ] == 92 ) )
{
incr ( exbufptr ) ;
while ( ( ( exbufptr < exbuflength ) && ( bracelevel > 0 ) ) ) {
incr ( exbufptr ) ;
exbufxptr = exbufptr ;
while ( ( ( exbufptr < exbuflength ) && ( lexclass [ exbuf [
exbufptr ] ] == 2 ) ) ) incr ( exbufptr ) ;
if ( ( ( exbufptr < exbuflength ) && ( exbufptr == exbufxptr ) )
)
incr ( exbufptr ) ;
else {
controlseqloc = strlookup ( exbuf , exbufxptr , exbufptr -
exbufxptr , 14 , false ) ;
if ( ( hashfound ) )
{
switch ( ( ilkinfo [ controlseqloc ] ) )
{case 12 :
bibstringwidth = bibstringwidth + 500 ;
break ;
case 4 :
bibstringwidth = bibstringwidth + 722 ;
break ;
case 2 :
bibstringwidth = bibstringwidth + 778 ;
break ;
case 5 :
bibstringwidth = bibstringwidth + 903 ;
break ;
case 3 :
bibstringwidth = bibstringwidth + 1014 ;
break ;
default:
bibstringwidth = bibstringwidth + charwidth [ exbuf [ exbufxptr
] ] ;
break ;
}
}
}
while ( ( ( exbufptr < exbuflength ) && ( lexclass [ exbuf [
exbufptr ] ] == 1 ) ) ) incr ( exbufptr ) ;
while ( ( ( exbufptr < exbuflength ) && ( bracelevel > 0 ) && (
exbuf [ exbufptr ] != 92 ) ) ) {
if ( ( exbuf [ exbufptr ] == 125 ) )
decr ( bracelevel ) ;
else if ( ( exbuf [ exbufptr ] == 123 ) )
incr ( bracelevel ) ;
else bibstringwidth = bibstringwidth + charwidth [ exbuf [ exbufptr
] ] ;
incr ( exbufptr ) ;
}
}
decr ( exbufptr ) ;
}
else bibstringwidth = bibstringwidth + charwidth [ 123 ] ;
else bibstringwidth = bibstringwidth + charwidth [ 123 ] ;
}
else if ( ( exbuf [ exbufptr ] == 125 ) )
{
decrbracelevel ( poplit1 ) ;
bibstringwidth = bibstringwidth + charwidth [ 125 ] ;
}
else bibstringwidth = bibstringwidth + charwidth [ exbuf [ exbufptr ] ] ;
incr ( exbufptr ) ;
}
checkbracelevel ( poplit1 ) ;
}
pushlitstk ( bibstringwidth , 0 ) ;
}
}
void xwrite (void) {
poplitstk ( poplit1 , poptyp1 ) ;
if ( ( poptyp1 != 1 ) )
printwrongstklit ( poplit1 , poptyp1 , 1 ) ;
else addoutpool ( poplit1 ) ;
}
#include "BibTeX.h"
#include "BibTeX.p"
#include "globals.h"
#include "coerce.h"
void
#ifdef STDC
zexecutefn (hashloc exfnloc )
#else
zexecutefn ( exfnloc )
hashloc exfnloc ;
#endif
{/* 51 */ integer rpoplt1, rpoplt2 ;
stktype rpoptp1, rpoptp2 ;
wizfnloc wizptr ;
;
#ifdef TRACE
{
(void) ReverseFPuts( logfile , "execute_fn `" ) ;
}
{
outpoolstr ( logfile , hashtext [ exfnloc ] ) ;
}
{
(void) FPrintF( logfile , "%c\r", '\'' ) ;
}
#endif /* TRACE */
switch ( ( fntype [ exfnloc ] ) )
{case 0 :
{
;
#ifdef STAT
incr ( executioncount [ ilkinfo [ exfnloc ] ] ) ;
#endif /* STAT */
switch ( ( ilkinfo [ exfnloc ] ) )
{case 0 :
xequals () ;
break ;
case 1 :
xgreaterthan () ;
break ;
case 2 :
xlessthan () ;
break ;
case 3 :
xplus () ;
break ;
case 4 :
xminus () ;
break ;
case 5 :
xconcatenate () ;
break ;
case 6 :
xgets () ;
break ;
case 7 :
xaddperiod () ;
break ;
case 8 :
{
if ( ( ! messwithentries ) )
bstcantmesswithentri () ;
else if ( ( typelist [ citeptr ] == 5001 ) )
executefn ( bdefault ) ;
else if ( ( typelist [ citeptr ] == 0 ) )
;
else executefn ( typelist [ citeptr ] ) ;
}
break ;
case 9 :
xchangecase () ;
break ;
case 10 :
xchrtoint () ;
break ;
case 11 :
xcite () ;
break ;
case 12 :
xduplicate () ;
break ;
case 13 :
xempty () ;
break ;
case 14 :
xformatname () ;
break ;
case 15 :
{
poplitstk ( poplit1 , poptyp1 ) ;
poplitstk ( poplit2 , poptyp2 ) ;
poplitstk ( poplit3 , poptyp3 ) ;
if ( ( poptyp1 != 2 ) )
printwrongstklit ( poplit1 , poptyp1 , 2 ) ;
else if ( ( poptyp2 != 2 ) )
printwrongstklit ( poplit2 , poptyp2 , 2 ) ;
else if ( ( poptyp3 != 0 ) )
printwrongstklit ( poplit3 , poptyp3 , 0 ) ;
else if ( ( poplit3 > 0 ) )
executefn ( poplit2 ) ;
else executefn ( poplit1 ) ;
}
break ;
case 16 :
xinttochr () ;
break ;
case 17 :
xinttostr () ;
break ;
case 18 :
xmissing () ;
break ;
case 19 :
{
outputbblline () ;
}
break ;
case 20 :
xnumnames () ;
break ;
case 21 :
{
poplitstk ( poplit1 , poptyp1 ) ;
}
break ;
case 22 :
xpreamble () ;
break ;
case 23 :
xpurify () ;
break ;
case 24 :
xquote () ;
break ;
case 25 :
{
;
}
break ;
case 26 :
{
popwholestack () ;
}
break ;
case 27 :
xsubstring () ;
break ;
case 28 :
xswap () ;
break ;
case 29 :
xtextlength () ;
break ;
case 30 :
xtextprefix () ;
break ;
case 31 :
{
poptopandprint () ;
}
break ;
case 32 :
xtype () ;
break ;
case 33 :
xwarning () ;
break ;
case 34 :
{
poplitstk ( rpoplt1 , rpoptp1 ) ;
poplitstk ( rpoplt2 , rpoptp2 ) ;
if ( ( rpoptp1 != 2 ) )
printwrongstklit ( rpoplt1 , rpoptp1 , 2 ) ;
else if ( ( rpoptp2 != 2 ) )
printwrongstklit ( rpoplt2 , rpoptp2 , 2 ) ;
else while ( true ) {
executefn ( rpoplt2 ) ;
poplitstk ( poplit1 , poptyp1 ) ;
if ( ( poptyp1 != 0 ) )
{
printwrongstklit ( poplit1 , poptyp1 , 0 ) ;
goto lab51 ;
}
else if ( ( poplit1 > 0 ) )
executefn ( rpoplt1 ) ;
else goto lab51 ;
}
lab51: ;
}
break ;
case 35 :
xwidth () ;
break ;
case 36 :
xwrite () ;
break ;
default:
{
{
(void) ReverseFPuts( logfile , "Unknown built-in function" ) ;
(void) FPrintFStdErr( "Unknown built-in function" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
break ;
}
}
break ;
case 1 :
{
wizptr = ilkinfo [ exfnloc ] ;
while ( ( wizfunctions [ wizptr ] != 5001 ) ) {
if ( ( wizfunctions [ wizptr ] != 0 ) )
executefn ( wizfunctions [ wizptr ] ) ;
else {
incr ( wizptr ) ;
pushlitstk ( wizfunctions [ wizptr ] , 2 ) ;
}
incr ( wizptr ) ;
}
}
break ;
case 2 :
pushlitstk ( ilkinfo [ exfnloc ] , 0 ) ;
break ;
case 3 :
pushlitstk ( hashtext [ exfnloc ] , 1 ) ;
break ;
case 4 :
{
if ( ( ! messwithentries ) )
bstcantmesswithentri () ;
else {
fieldptr = citeptr * numfields + ilkinfo [ exfnloc ] ;
if ( ( fieldinfo [ fieldptr ] == 0 ) )
pushlitstk ( hashtext [ exfnloc ] , 3 ) ;
else pushlitstk ( fieldinfo [ fieldptr ] , 1 ) ;
}
}
break ;
case 5 :
{
if ( ( ! messwithentries ) )
bstcantmesswithentri () ;
else pushlitstk ( entryints [ citeptr * numentints + ilkinfo [ exfnloc ]
] , 0 ) ;
}
break ;
case 6 :
{
if ( ( ! messwithentries ) )
bstcantmesswithentri () ;
else {
strentptr = citeptr * numentstrs + ilkinfo [ exfnloc ] ;
exbufptr = 0 ;
while ( ( entrystrs [ strentptr ] [ exbufptr ] != 127 ) ) {
exbuf [ exbufptr ] = entrystrs [ strentptr ] [ exbufptr ] ;
incr ( exbufptr ) ;
}
exbuflength = exbufptr ;
addpoolbufandpush () ;
}
}
break ;
case 7 :
pushlitstk ( ilkinfo [ exfnloc ] , 0 ) ;
break ;
case 8 :
{
strglbptr = ilkinfo [ exfnloc ] ;
if ( ( glbstrptr [ strglbptr ] > 0 ) )
pushlitstk ( glbstrptr [ strglbptr ] , 1 ) ;
else {
{
if ( ( poolptr + glbstrend [ strglbptr ] > poolsize ) )
pooloverflow () ;
}
globchrptr = 0 ;
while ( ( globchrptr < glbstrend [ strglbptr ] ) ) {
{
strpool [ poolptr ] = globalstrs [ strglbptr ] [ globchrptr ] ;
incr ( poolptr ) ;
}
incr ( globchrptr ) ;
}
pushlitstk ( makestring () , 1 ) ;
}
}
break ;
default:
unknwnfunctionclassc () ;
break ;
}
}
/* Vince changes here */
void getthetoplevelauxfil (void) {
/* 41 46 */ while ( true ) {
// we have the aux-file already, so none of this:
/*
if ( ( gargc > 1 ) )
auxnamelength = getcmdline ( nameoffile , 1024 ) ;
else {
(void) FPrintFStdErr( "Please type input file name (no extension)--" ) ;
auxnamelength = 0 ;
while ( ( ! eoln ( stdin ) ) ) {
if ( ( auxnamelength == 1024 ) )
{
readln ( stdin ) ;
{
samtoolongfilenamepr () ;
goto lab46 ;
}
}
nameoffile [ auxnamelength ] = getc ( stdin ) ;
incr ( auxnamelength ) ;
}
}
*/ //end of my cut-out
//gAuxDesc is our top file.
strncpy(nameoffile, aux_fn, 1024);
// currently assume there is an extension
auxnamelength = strlen(nameoffile);
nameoffile[auxnamelength-4] = '\0';
auxnamelength -= 4;
{
if ( ( ( auxnamelength + ( strstart [ sauxextension + 1 ] - strstart [
sauxextension ] ) > 1024 ) || ( auxnamelength + ( strstart [
slogextension + 1 ] - strstart [ slogextension ] ) > 1024 ) || (
auxnamelength + ( strstart [ sbblextension + 1 ] - strstart [
sbblextension ] ) > 1024 ) ) )
{
samtoolongfilenamepr () ;
goto lab46 ;
}
{
namelength = auxnamelength ;
addextension ( sauxextension ) ;
auxptr = 0 ;
if ( ( ! aopenin ( auxfile [ auxptr ] ) ) )
{
samwrongfilenameprin () ;
goto lab46 ;
}
namelength = auxnamelength ;
addextension ( slogextension ) ;
if ( ( ! aopenout ( logfile ) ) )
{
samwrongfilenameprin () ;
goto lab46 ;
}
namelength = auxnamelength ;
addextension ( sbblextension ) ;
if ( ( ! aopenout ( bblfile ) ) )
{
samwrongfilenameprin () ;
goto lab46 ;
}
}
{
namelength = auxnamelength ;
addextension ( sauxextension ) ;
nameptr = 1 ;
while ( ( nameptr <= namelength ) ) {
buffer [ nameptr ] = xord [ nameoffile [ nameptr - 1 ] ] ;
incr ( nameptr ) ;
}
toplevstr = hashtext [ strlookup ( buffer , 1 , auxnamelength , 0 ,
true ) ] ;
auxlist [ auxptr ] = hashtext [ strlookup ( buffer , 1 , namelength ,
3 , true ) ] ;
if ( ( hashfound ) )
{
;
#ifdef TRACE
printauxname () ;
#endif /* TRACE */
{
{
(void) ReverseFPuts( logfile , "Already encountered auxiliary file" ) ;
(void) FPrintFStdErr( "Already encountered auxiliary file" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
}
auxlnstack [ auxptr ] = 0 ;
}
goto lab41 ;
}
lab46: ;//gargc = 0 ;
}
lab41: ;
}
void auxbibdatacommand (void) {
/* 10 */ if ( ( bibseen ) )
{
auxerrillegalanother ( 0 ) ;
{
auxerrprint () ;
goto lab10 ;
}
}
bibseen = true ;
while ( ( buffer [ bufptr2 ] != 125 ) ) {
incr ( bufptr2 ) ;
if ( ( ! scan2white ( 125 , 44 ) ) )
{
auxerrnorightbracepr () ;
{
auxerrprint () ;
goto lab10 ;
}
}
if ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) )
{
auxerrwhitespaceinar () ;
{
auxerrprint () ;
goto lab10 ;
}
}
if ( ( ( last > bufptr2 + 1 ) && ( buffer [ bufptr2 ] == 125 ) ) )
{
auxerrstuffafterrigh () ;
{
auxerrprint () ;
goto lab10 ;
}
}
{
if ( ( bibptr == maxbibfiles ) )
{
printoverflow () ;
{
(void) FPrintF( logfile , "%s%ld\r", "number of database files " , (long)maxbibfiles ) ;
(void) FPrintFStdErr( "%s%ld\r", "number of database files " , (long)maxbibfiles ) ;
}
longjmp(jmp9998,1) ;
}
biblist [ bibptr ] = hashtext [ strlookup ( buffer , bufptr1 , ( bufptr2
- bufptr1 ) , 6 , true ) ] ;
if ( ( hashfound ) )
{
{
(void) ReverseFPuts( logfile , "This database file appears more than once: " ) ;
(void) FPrintFStdErr( "This database file appears more than once: " ) ;
}
printbibname () ;
{
auxerrprint () ;
goto lab10 ;
}
}
startname ( biblist [ bibptr ] ) ;
addextension ( sbibextension ) ;
if ( ( ! aopenin ( bibfile [ bibptr ] ) ) )
{
addarea ( sbibarea ) ;
if ( ( ! aopenin ( bibfile [ bibptr ] ) ) )
{
{
(void) ReverseFPuts( logfile , "I couldn't open database file " ) ;
(void) FPrintFStdErr( "I couldn't open database file " ) ;
}
printbibname () ;
{
auxerrprint () ;
goto lab10 ;
}
}
}
;
#ifdef TRACE
{
outpoolstr ( logfile , biblist [ bibptr ] ) ;
}
{
outpoolstr ( logfile , sbibextension ) ;
}
{
(void) FPrintF( logfile , "%s\r", " is a bibdata file" ) ;
}
#endif /* TRACE */
incr ( bibptr ) ;
}
}
lab10: ;
}
void auxbibstylecommand (void) {
/* 10 */ if ( ( bstseen ) )
{
auxerrillegalanother ( 1 ) ;
{
auxerrprint () ;
goto lab10 ;
}
}
bstseen = true ;
incr ( bufptr2 ) ;
if ( ( ! scan1white ( 125 ) ) )
{
auxerrnorightbracepr () ;
{
auxerrprint () ;
goto lab10 ;
}
}
if ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) )
{
auxerrwhitespaceinar () ;
{
auxerrprint () ;
goto lab10 ;
}
}
if ( ( last > bufptr2 + 1 ) )
{
auxerrstuffafterrigh () ;
{
auxerrprint () ;
goto lab10 ;
}
}
{
bststr = hashtext [ strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) ,
5 , true ) ] ;
if ( ( hashfound ) )
{
;
#ifdef TRACE
printbstname () ;
#endif /* TRACE */
{
{
(void) ReverseFPuts( logfile , "Already encountered style file" ) ;
(void) FPrintFStdErr( "Already encountered style file" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
}
startname ( bststr ) ;
addextension ( sbstextension ) ;
if ( ( ! aopenin ( bstfile ) ) )
{
addarea ( sbstarea ) ;
if ( ( ! aopenin ( bstfile ) ) )
{
{
(void) ReverseFPuts( logfile , "I couldn't open style file " ) ;
(void) FPrintFStdErr( "I couldn't open style file " ) ;
}
printbstname () ;
bststr = 0 ;
{
auxerrprint () ;
goto lab10 ;
}
}
}
{
(void) ReverseFPuts( logfile , "The style file: " ) ;
(void) FPrintFStdErr( "The style file: " ) ;
}
printbstname () ;
}
lab10: ;
}
void auxcitationcommand (void) {
/* 23 10 */ citationseen = true ;
while ( ( buffer [ bufptr2 ] != 125 ) ) {
incr ( bufptr2 ) ;
if ( ( ! scan2white ( 125 , 44 ) ) )
{
auxerrnorightbracepr () ;
{
auxerrprint () ;
goto lab10 ;
}
}
if ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) )
{
auxerrwhitespaceinar () ;
{
auxerrprint () ;
goto lab10 ;
}
}
if ( ( ( last > bufptr2 + 1 ) && ( buffer [ bufptr2 ] == 125 ) ) )
{
auxerrstuffafterrigh () ;
{
auxerrprint () ;
goto lab10 ;
}
}
{
;
#ifdef TRACE
{
outtoken ( logfile ) ;
}
{
(void) ReverseFPuts( logfile , " cite key encountered" ) ;
}
#endif /* TRACE */
{
if ( ( ( bufptr2 - bufptr1 ) == 1 ) )
if ( ( buffer [ bufptr1 ] == 42 ) )
{
;
#ifdef TRACE
{
(void) FPrintF( logfile , "%s\r", "---entire database to be included" ) ;
}
#endif /* TRACE */
if ( ( allentries ) )
{
{
(void) FPrintF( logfile , "%s\r", "Multiple inclusions of entire database" ) ;
(void) FPrintFStdErr( "%s\r", "Multiple inclusions of entire database" ) ;
}
{
auxerrprint () ;
goto lab10 ;
}
}
else {
allentries = true ;
allmarker = citeptr ;
goto lab23 ;
}
}
}
tmpptr = bufptr1 ;
while ( ( tmpptr < bufptr2 ) ) {
exbuf [ tmpptr ] = buffer [ tmpptr ] ;
incr ( tmpptr ) ;
}
lowercase ( exbuf , bufptr1 , ( bufptr2 - bufptr1 ) ) ;
lcciteloc = strlookup ( exbuf , bufptr1 , ( bufptr2 - bufptr1 ) , 10 ,
true ) ;
if ( ( hashfound ) )
{
;
#ifdef TRACE
{
(void) FPrintF( logfile , "%s\r", " previously" ) ;
}
#endif /* TRACE */
dummyloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 9 ,
false ) ;
if ( ( ! hashfound ) )
{
{
(void) ReverseFPuts( logfile , "Case mismatch error between cite keys " ) ;
(void) FPrintFStdErr( "Case mismatch error between cite keys " ) ;
}
printatoken () ;
{
(void) ReverseFPuts( logfile , " and " ) ;
(void) FPrintFStdErr( " and " ) ;
}
printapoolstr ( citelist [ ilkinfo [ ilkinfo [ lcciteloc ] ] ] ) ;
printanewline () ;
{
auxerrprint () ;
goto lab10 ;
}
}
}
else {
;
#ifdef TRACE
{
(void) FPutC('\r', logfile );
}
#endif /* TRACE */
citeloc = strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 ) , 9 ,
true ) ;
if ( ( hashfound ) )
hashciteconfusion () ;
checkciteoverflow ( citeptr ) ;
citelist [ citeptr ] = hashtext [ citeloc ] ;
ilkinfo [ citeloc ] = citeptr ;
ilkinfo [ lcciteloc ] = citeloc ;
incr ( citeptr ) ;
}
}
lab23: ;
}
lab10: ;
}
void auxinputcommand (void) {
/* 10 */ boolean auxextensionok ;
incr ( bufptr2 ) ;
if ( ( ! scan1white ( 125 ) ) )
{
auxerrnorightbracepr () ;
{
auxerrprint () ;
goto lab10 ;
}
}
if ( ( lexclass [ buffer [ bufptr2 ] ] == 1 ) )
{
auxerrwhitespaceinar () ;
{
auxerrprint () ;
goto lab10 ;
}
}
if ( ( last > bufptr2 + 1 ) )
{
auxerrstuffafterrigh () ;
{
auxerrprint () ;
goto lab10 ;
}
}
{
incr ( auxptr ) ;
if ( ( auxptr == auxstacksize ) )
{
printatoken () ;
{
(void) ReverseFPuts( logfile , ": " ) ;
(void) FPrintFStdErr( ": " ) ;
}
{
printoverflow () ;
{
(void) FPrintF( logfile , "%s%ld\r", "auxiliary file depth " , (long)auxstacksize ) ;
(void) FPrintFStdErr( "%s%ld\r", "auxiliary file depth " , (long)auxstacksize ) ;
}
longjmp(jmp9998,1) ;
}
}
auxextensionok = true ;
if ( ( ( bufptr2 - bufptr1 ) < ( strstart [ sauxextension + 1 ] - strstart
[ sauxextension ] ) ) )
auxextensionok = false ;
else if ( ( ! streqbuf ( sauxextension , buffer , bufptr2 - ( strstart [
sauxextension + 1 ] - strstart [ sauxextension ] ) , ( strstart [
sauxextension + 1 ] - strstart [ sauxextension ] ) ) ) )
auxextensionok = false ;
if ( ( ! auxextensionok ) )
{
printatoken () ;
{
(void) ReverseFPuts( logfile , " has a wrong extension" ) ;
(void) FPrintFStdErr( " has a wrong extension" ) ;
}
decr ( auxptr ) ;
{
auxerrprint () ;
goto lab10 ;
}
}
auxlist [ auxptr ] = hashtext [ strlookup ( buffer , bufptr1 , ( bufptr2 -
bufptr1 ) , 3 , true ) ] ;
if ( ( hashfound ) )
{
{
(void) ReverseFPuts( logfile , "Already encountered file " ) ;
(void) FPrintFStdErr( "Already encountered file " ) ;
}
printauxname () ;
decr ( auxptr ) ;
{
auxerrprint () ;
goto lab10 ;
}
}
{
startname ( auxlist [ auxptr ] ) ;
nameptr = namelength ;
while ( ( nameptr <= 1024 ) ) {
nameoffile [ nameptr ] = ' ' ;
incr ( nameptr ) ;
}
if ( ( ! aopenin ( auxfile [ auxptr ] ) ) )
{
{
(void) ReverseFPuts( logfile , "I couldn't open auxiliary file " ) ;
(void) FPrintFStdErr( "I couldn't open auxiliary file " ) ;
}
printauxname () ;
decr ( auxptr ) ;
{
auxerrprint () ;
goto lab10 ;
}
}
{
(void) FPrintF( logfile , "%s%ld%s", "A level-" , (long)auxptr , " auxiliary file: " ) ;
(void) FPrintFStdErr( "%s%ld%s", "A level-" , (long)auxptr , " auxiliary file: " ) ;
}
printauxname () ;
auxlnstack [ auxptr ] = 0 ;
}
}
lab10: ;
}
void poptheauxstack (void) {
aclose ( auxfile [ auxptr ] ) ;
if ( ( auxptr == 0 ) )
{lab31=1; return;}
else decr ( auxptr ) ;
}
void getauxcommandandproc (void) {
/* 10 */ bufptr2 = 0 ;
if ( ( ! scan1 ( 123 ) ) )
goto lab10 ;
commandnum = ilkinfo [ strlookup ( buffer , bufptr1 , ( bufptr2 - bufptr1 )
, 2 , false ) ] ;
if ( ( hashfound ) )
switch ( ( commandnum ) )
{case 0 :
auxbibdatacommand () ;
break ;
case 1 :
auxbibstylecommand () ;
break ;
case 2 :
auxcitationcommand () ;
break ;
case 3 :
auxinputcommand () ;
break ;
default:
{
{
(void) ReverseFPuts( logfile , "Unknown auxiliary-file command" ) ;
(void) FPrintFStdErr( "Unknown auxiliary-file command" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
break ;
}
lab10: ;
}
void lastcheckforauxerror (void) {
numcites = citeptr ;
numbibfiles = bibptr ;
if ( ( ! citationseen ) )
{
auxend1errprint () ;
{
(void) ReverseFPuts( logfile , "\\citation commands" ) ;
(void) FPrintFStdErr( "\\citation commands" ) ;
}
auxend2errprint () ;
}
else if ( ( ( numcites == 0 ) && ( ! allentries ) ) )
{
auxend1errprint () ;
{
(void) ReverseFPuts( logfile , "cite keys" ) ;
(void) FPrintFStdErr( "cite keys" ) ;
}
auxend2errprint () ;
}
if ( ( ! bibseen ) )
{
auxend1errprint () ;
{
(void) ReverseFPuts( logfile , "\\bibdata command" ) ;
(void) FPrintFStdErr( "\\bibdata command" ) ;
}
auxend2errprint () ;
}
else if ( ( numbibfiles == 0 ) )
{
auxend1errprint () ;
{
(void) ReverseFPuts( logfile , "database files" ) ;
(void) FPrintFStdErr( "database files" ) ;
}
auxend2errprint () ;
}
if ( ( ! bstseen ) )
{
auxend1errprint () ;
{
(void) ReverseFPuts( logfile , "\\bibstyle command" ) ;
(void) FPrintFStdErr( "\\bibstyle command" ) ;
}
auxend2errprint () ;
}
else if ( ( bststr == 0 ) )
{
auxend1errprint () ;
{
(void) ReverseFPuts( logfile , "style file" ) ;
(void) FPrintFStdErr( "style file" ) ;
}
auxend2errprint () ;
}
}
#include "BibTeX.h"
#include "BibTeX.p"
#include "globals.h"
#include "coerce.h"
void bibidprint (void) {
if ( ( scanresult == 0 ) )
{
(void) ReverseFPuts( logfile , "You're missing " ) ;
(void) FPrintFStdErr( "You're missing " ) ;
}
else if ( ( scanresult == 2 ) )
{
(void) FPrintF( logfile , "%c%c%s", '"' , xchr [ buffer [ bufptr2 ] ] , "\" immediately follows " ) ;
(void) FPrintFStdErr( "%c%c%s", '"' , xchr [ buffer [ bufptr2 ] ] , "\" immediately follows " ) ;
}
else idscanningconfusion () ;
}
void bibcmdconfusion (void) {
{
{
(void) ReverseFPuts( logfile , "Unknown database-file command" ) ;
(void) FPrintFStdErr( "Unknown database-file command" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
}
void citekeydisappearedco (void) {
{
{
(void) ReverseFPuts( logfile , "A cite key disappeared" ) ;
(void) FPrintFStdErr( "A cite key disappeared" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
}
void
#ifdef STDC
zbadcrossreferencepri (strnumber s )
#else
zbadcrossreferencepri ( s )
strnumber s ;
#endif
{{
(void) ReverseFPuts( logfile , "--entry \"" ) ;
(void) FPrintFStdErr( "--entry \"" ) ;
}
printapoolstr ( citelist [ citeptr ] ) ;
{
(void) FPrintF( logfile , "%c\r", '"' ) ;
(void) FPrintFStdErr( "%c\r", '"' ) ;
}
{
(void) ReverseFPuts( logfile , "refers to entry \"" ) ;
(void) FPrintFStdErr( "refers to entry \"" ) ;
}
printapoolstr ( s ) ;
}
void nonexistentcrossrefe (void) {
{
(void) ReverseFPuts( logfile , "A bad cross reference-" ) ;
(void) FPrintFStdErr( "A bad cross reference-" ) ;
}
badcrossreferencepri ( fieldinfo [ fieldptr ] ) ;
{
(void) FPrintF( logfile , "%s%ld\r", "\", (long)which doesn't exist" ) ;
(void) FPrintFStdErr( "%s%ld\r", "\", (long)which doesn't exist" ) ;
}
markerror () ;
}
void
#ifdef STDC
zprintmissingentry (strnumber s )
#else
zprintmissingentry ( s )
strnumber s ;
#endif
{
{
(void) ReverseFPuts( logfile , "Warning--I didn't find a database entry for \"" ) ;
(void) FPrintFStdErr( "Warning--I didn't find a database entry for \"" ) ;
}
printapoolstr ( s ) ;
{
(void) FPrintF( logfile , "%c\r", '"' ) ;
(void) FPrintFStdErr( "%c\r", '"' ) ;
}
markwarning () ;
}
void bstexwarnprint (void) {
if ( ( messwithentries ) )
{
{
(void) ReverseFPuts( logfile , " for entry " ) ;
(void) FPrintFStdErr( " for entry " ) ;
}
printapoolstr ( citelist [ citeptr ] ) ;
}
printanewline () ;
{
(void) ReverseFPuts( logfile , "while executing-" ) ;
(void) FPrintFStdErr( "while executing-" ) ;
}
bstlnnumprint () ;
markerror () ;
}
void bstmildexwarnprint (void) {
if ( ( messwithentries ) )
{
{
(void) ReverseFPuts( logfile , " for entry " ) ;
(void) FPrintFStdErr( " for entry " ) ;
}
printapoolstr ( citelist [ citeptr ] ) ;
}
printanewline () ;
{
{
(void) ReverseFPuts( logfile , "while executing" ) ;
(void) FPrintFStdErr( "while executing" ) ;
}
bstwarnprint () ;
}
}
void bstcantmesswithentri (void) {
{
{
(void) ReverseFPuts( logfile , "You can't mess with entries here" ) ;
(void) FPrintFStdErr( "You can't mess with entries here" ) ;
}
bstexwarnprint () ;
}
}
void illeglliteralconfusi (void) {
{
{
(void) ReverseFPuts( logfile , "Illegal literal type" ) ;
(void) FPrintFStdErr( "Illegal literal type" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
}
void unknwnliteralconfusi (void) {
{
{
(void) ReverseFPuts( logfile , "Unknown literal type" ) ;
(void) FPrintFStdErr( "Unknown literal type" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
}
void
#ifdef STDC
zprintstklit (integer stklt ,stktype stktp )
#else
zprintstklit ( stklt , stktp )
integer stklt ;
stktype stktp ;
#endif
{switch ( ( stktp ) )
{case 0 :
{
(void) FPrintF( logfile , "%ld%s", (long)stklt , " is an integer literal" ) ;
(void) FPrintFStdErr( "%ld%s", (long)stklt , " is an integer literal" ) ;
}
break ;
case 1 :
{
{
(void) FPutC( '"' , logfile );
(void) FPutC( '"' );
}
printapoolstr ( stklt ) ;
{
(void) ReverseFPuts( logfile , "\" is a string literal" ) ;
(void) FPrintFStdErr( "\" is a string literal" ) ;
}
}
break ;
case 2 :
{
{
(void) FPutC( '`' , logfile );
(void) FPutC( '`' );
}
printapoolstr ( hashtext [ stklt ] ) ;
{
(void) ReverseFPuts( logfile , "' is a function literal" ) ;
(void) FPrintFStdErr( "' is a function literal" ) ;
}
}
break ;
case 3 :
{
{
(void) FPutC( '`' , logfile );
(void) FPutC( '`' );
}
printapoolstr ( stklt ) ;
{
(void) ReverseFPuts( logfile , "' is a missing field" ) ;
(void) FPrintFStdErr( "' is a missing field" ) ;
}
}
break ;
case 4 :
illeglliteralconfusi () ;
break ;
default:
unknwnliteralconfusi () ;
break ;
}
}
void
#ifdef STDC
zprintlit (integer stklt ,stktype stktp )
#else
zprintlit ( stklt , stktp )
integer stklt ;
stktype stktp ;
#endif
{switch ( ( stktp ) )
{case 0 :
{
(void) FPrintF( logfile , "%ld\r", (long)stklt ) ;
(void) FPrintFStdErr( "%ld\r", (long)stklt ) ;
}
break ;
case 1 :
{
printapoolstr ( stklt ) ;
printanewline () ;
}
break ;
case 2 :
{
printapoolstr ( hashtext [ stklt ] ) ;
printanewline () ;
}
break ;
case 3 :
{
printapoolstr ( stklt ) ;
printanewline () ;
}
break ;
case 4 :
illeglliteralconfusi () ;
break ;
default:
unknwnliteralconfusi () ;
break ;
}
}
void outputbblline (void) {
/* 15 10 */ if ( ( outbuflength != 0 ) )
{
while ( ( outbuflength > 0 ) ) if ( ( lexclass [ outbuf [ outbuflength - 1
] ] == 1 ) )
decr ( outbuflength ) ;
else goto lab15 ;
lab15: if ( ( outbuflength == 0 ) )
goto lab10 ;
outbufptr = 0 ;
while ( ( outbufptr < outbuflength ) ) {
(void) FPutC( xchr [ outbuf [ outbufptr ] ] , bblfile );
incr ( outbufptr ) ;
}
}
(void) FPutC('\r', bblfile );
incr ( bbllinenum ) ;
outbuflength = 0 ;
lab10: ;
}
void bst1printstringsizee (void) {
{
(void) ReverseFPuts( logfile , "Warning--you've exceeded " ) ;
(void) FPrintFStdErr( "Warning--you've exceeded " ) ;
}
}
void bst2printstringsizee (void) {
{
(void) ReverseFPuts( logfile , "-string-size," ) ;
(void) FPrintFStdErr( "-string-size," ) ;
}
bstmildexwarnprint () ;
{
(void) FPrintF( logfile , "%s\r", "*Please notify the bibstyle designer*" ) ;
(void) FPrintFStdErr( "%s\r", "*Please notify the bibstyle designer*" ) ;
}
}
void
#ifdef STDC
zbracesunbalancedcomp (strnumber poplitvar )
#else
zbracesunbalancedcomp ( poplitvar )
strnumber poplitvar ;
#endif
{{
(void) ReverseFPuts( logfile , "Warning--\"" ) ;
(void) FPrintFStdErr( "Warning--\"" ) ;
}
printapoolstr ( poplitvar ) ;
{
{
(void) ReverseFPuts( logfile , "\" isn't a brace-balanced string" ) ;
(void) FPrintFStdErr( "\" isn't a brace-balanced string" ) ;
}
bstmildexwarnprint () ;
}
}
void caseconversionconfus (void) {
{
{
(void) ReverseFPuts( logfile , "Unknown type of case conversion" ) ;
(void) FPrintFStdErr( "Unknown type of case conversion" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
}
void traceandstatprinting (void) {
;
#ifdef TRACE
{
if ( ( numbibfiles == 1 ) )
{
(void) FPrintF( logfile , "%s\r", "The 1 database file is" ) ;
}
else {
(void) FPrintF( logfile , "%s%ld%s\r", "The " , (long)numbibfiles , " database files are" ) ;
}
if ( ( numbibfiles == 0 ) )
{
(void) FPrintF( logfile , "%s\r", " undefined" ) ;
}
else {
bibptr = 0 ;
while ( ( bibptr < numbibfiles ) ) {
{
(void) ReverseFPuts( logfile , " " ) ;
}
{
outpoolstr ( logfile , biblist [ bibptr ] ) ;
}
{
outpoolstr ( logfile , sbibextension ) ;
}
{
(void) FPutC('\r', logfile );
}
incr ( bibptr ) ;
}
}
{
(void) ReverseFPuts( logfile , "The style file is " ) ;
}
if ( ( bststr == 0 ) )
{
(void) FPrintF( logfile , "%s\r", "undefined" ) ;
}
else {
{
outpoolstr ( logfile , bststr ) ;
}
{
outpoolstr ( logfile , sbstextension ) ;
}
{
(void) FPutC('\r', logfile );
}
}
}
{
if ( ( allentries ) )
{
(void) FPrintF( logfile , "%s%ld%s", "all_marker=" , (long)allmarker , ", " ) ;
}
if ( ( readperformed ) )
{
(void) FPrintF( logfile , "%s%ld\r", "old_num_cites=" , (long)oldnumcites ) ;
}
else {
(void) FPutC('\r', logfile );
}
{
(void) FPrintF( logfile , "%s%ld", "The " , (long)numcites ) ;
}
if ( ( numcites == 1 ) )
{
(void) FPrintF( logfile , "%s\r", " entry:" ) ;
}
else {
(void) FPrintF( logfile , "%s\r", " entries:" ) ;
}
if ( ( numcites == 0 ) )
{
(void) FPrintF( logfile , "%s\r", " undefined" ) ;
}
else {
sortciteptr = 0 ;
while ( ( sortciteptr < numcites ) ) {
if ( ( ! readcompleted ) )
citeptr = sortciteptr ;
else citeptr = citeinfo [ sortciteptr ] ;
{
outpoolstr ( logfile , citelist [ citeptr ] ) ;
}
if ( ( readperformed ) )
{
{
(void) ReverseFPuts( logfile , ", entry-type " ) ;
}
if ( ( typelist [ citeptr ] == 5001 ) )
lab5001: {
(void) ReverseFPuts( logfile , "unknown" ) ;
}
else if ( ( typelist [ citeptr ] == 0 ) )
{
(void) ReverseFPuts( logfile , "--- no type found" ) ;
}
else {
outpoolstr ( logfile , hashtext [ typelist [ citeptr ] ] ) ;
}
{
(void) FPrintF( logfile , "%s\r", ", has entry strings" ) ;
}
{
if ( ( numentstrs == 0 ) )
{
(void) FPrintF( logfile , "%s\r", " undefined" ) ;
}
else if ( ( ! readcompleted ) )
{
(void) FPrintF( logfile , "%s\r", " uninitialized" ) ;
}
else {
strentptr = citeptr * numentstrs ;
while ( ( strentptr < ( citeptr + 1 ) * numentstrs ) ) {
entchrptr = 0 ;
{
(void) ReverseFPuts( logfile , " \"" ) ;
}
while ( ( entrystrs [ strentptr ] [ entchrptr ] != 127 ) ) {
{
(void) FPutC( xchr [ entrystrs [ strentptr ] [ entchrptr ] ] , logfile );
}
incr ( entchrptr ) ;
}
{
(void) FPrintF( logfile , "%c\r", '"' ) ;
}
incr ( strentptr ) ;
}
}
}
{
(void) ReverseFPuts( logfile , " has entry integers" ) ;
}
{
if ( ( numentints == 0 ) )
{
(void) ReverseFPuts( logfile , " undefined" ) ;
}
else if ( ( ! readcompleted ) )
{
(void) ReverseFPuts( logfile , " uninitialized" ) ;
}
else {
intentptr = citeptr * numentints ;
while ( ( intentptr < ( citeptr + 1 ) * numentints ) ) {
{
(void) FPrintF( logfile , "%c%ld", ' ' , (long)entryints [ intentptr ] ) ;
}
incr ( intentptr ) ;
}
}
{
(void) FPutC('\r', logfile );
}
}
{
(void) FPrintF( logfile , "%s\r", " and has fields" ) ;
}
{
if ( ( ! readperformed ) )
{
(void) FPrintF( logfile , "%s\r", " uninitialized" ) ;
}
else {
fieldptr = citeptr * numfields ;
fieldendptr = fieldptr + numfields ;
nofields = true ;
while ( ( fieldptr < fieldendptr ) ) {
if ( ( fieldinfo [ fieldptr ] != 0 ) )
{
{
(void) ReverseFPuts( logfile , " \"" ) ;
}
{
outpoolstr ( logfile , fieldinfo [ fieldptr ] ) ;
}
{
(void) FPrintF( logfile , "%c\r", '"' ) ;
}
nofields = false ;
}
incr ( fieldptr ) ;
}
if ( ( nofields ) )
{
(void) FPrintF( logfile , "%s\r", " missing" ) ;
}
}
}
}
else {
(void) FPutC('\r', logfile );
}
incr ( sortciteptr ) ;
}
}
}
{
{
(void) FPrintF( logfile , "%s\r", "The wiz-defined functions are" ) ;
}
if ( ( wizdefptr == 0 ) )
{
(void) FPrintF( logfile , "%s\r", " nonexistent" ) ;
}
else {
wizfnptr = 0 ;
while ( ( wizfnptr < wizdefptr ) ) {
if ( ( wizfunctions [ wizfnptr ] == 5001 ) )
{
(void) FPrintF( logfile , "%ld%s\r", (long)wizfnptr , "--end-of-def--" ) ;
}
else if ( ( wizfunctions [ wizfnptr ] == 0 ) )
{
(void) FPrintF( logfile , "%ld%s", (long)wizfnptr , " quote_next_function " ) ;
}
else {
{
(void) FPrintF( logfile , "%ld%s", (long)wizfnptr , " `" ) ;
}
{
outpoolstr ( logfile , hashtext [ wizfunctions [ wizfnptr ] ] ) ;
}
{
(void) FPrintF( logfile , "%c\r", '\'' ) ;
}
}
incr ( wizfnptr ) ;
}
}
}
{
{
(void) FPrintF( logfile , "%s\r", "The string pool is" ) ;
}
strnum = 1 ;
while ( ( strnum < strptr ) ) {
{
(void) FPrintF( logfile , "%ld%ld%s", (long)strnum , (long)strstart [ strnum ] , " \"" ) ;
}
{
outpoolstr ( logfile , strnum ) ;
}
{
(void) FPrintF( logfile , "%c\r", '"' ) ;
}
incr ( strnum ) ;
}
}
#endif /* TRACE */
;
#ifdef STAT
{
{
(void) FPrintF( logfile , "%s%ld", "You've used " , (long)numcites ) ;
}
if ( ( numcites == 1 ) )
{
(void) FPrintF( logfile , "%s\r", " entry," ) ;
}
else {
(void) FPrintF( logfile , "%s\r", " entries," ) ;
}
{
(void) FPrintF( logfile , "%s%ld%s\r", " " , (long)wizdefptr , " wiz_defined-function locations," ) ;
}
{
(void) FPrintF( logfile , "%s%ld%s%ld%s\r", " " , (long)strptr , " strings with " , (long)strstart [ strptr ] , " characters," ) ;
}
bltinptr = 0 ;
totalexcount = 0 ;
while ( ( bltinptr < numbltinfns ) ) {
totalexcount = totalexcount + executioncount [ bltinptr ] ;
incr ( bltinptr ) ;
}
{
(void) FPrintF( logfile , "%s%ld%s\r", "and the built_in function-call counts, " , (long)totalexcount , " in all, are:" ) ;
}
bltinptr = 0 ;
while ( ( bltinptr < numbltinfns ) ) {
{
outpoolstr ( logfile , hashtext [ bltinloc [ bltinptr ] ] ) ;
}
{
(void) FPrintF( logfile , "%s%ld\r", " -- " , (long)executioncount [ bltinptr ] ) ;
}
incr ( bltinptr ) ;
}
}
#endif /* STAT */
}
#ifdef STDC
boolean zaopenin (palphafile * f )
#else
boolean zaopenin ( f )
palphafile * f ;
#endif
{register boolean Result; boolean ok ;
if ( testaccess ( 4 , 1 ) )
{
reset ( *f , realnameoffile ) ;
ok = true ;
}
else ok = false ;
Result = ok ;
return(Result) ;
}
#ifdef STDC
boolean zaopenout (palphafile * f )
#else
boolean zaopenout ( f )
palphafile * f ;
#endif
{register boolean Result; boolean ok ;
if ( testaccess ( 2 , 0 ) )
{
rewrite ( *f , realnameoffile ) ;
ok = true ;
}
else ok = false ;
Result = ok ;
return(Result) ;
}
void
#ifdef STDC
zstartname (strnumber filename )
#else
zstartname ( filename )
strnumber filename ;
#endif
{poolpointer pptr ;
if ( ( ( strstart [ filename + 1 ] - strstart [ filename ] ) > 1024 ) )
{
{
(void) ReverseFPuts( logfile , "File=" ) ;
(void) FPrintFStdErr( "File=" ) ;
}
printapoolstr ( filename ) ;
{
(void) FPrintF( logfile , "%c\r", ',' ) ;
(void) FPrintFStdErr( "%c\r", ',' ) ;
}
filenmsizeoverflow () ;
}
nameptr = 0 ;
pptr = strstart [ filename ] ;
while ( ( pptr < strstart [ filename + 1 ] ) ) {
nameoffile [ nameptr ] = chr ( strpool [ pptr ] ) ;
incr ( nameptr ) ;
incr ( pptr ) ;
}
namelength = ( strstart [ filename + 1 ] - strstart [ filename ] ) ;
}
void
#ifdef STDC
zaddextension (strnumber ext )
#else
zaddextension ( ext )
strnumber ext ;
#endif
{poolpointer pptr ;
if ( ( namelength + ( strstart [ ext + 1 ] - strstart [ ext ] ) > 1024 ) )
{
{
(void) FPrintF( logfile , "%s%c%s", "File=" , nameoffile , ", extension=" ) ;
(void) FPrintFStdErr( "%s%c%s", "File=" , nameoffile , ", extension=" ) ;
}
printapoolstr ( ext ) ;
{
(void) FPrintF( logfile , "%c\r", ',' ) ;
(void) FPrintFStdErr( "%c\r", ',' ) ;
}
filenmsizeoverflow () ;
}
nameptr = namelength ;
pptr = strstart [ ext ] ;
while ( ( pptr < strstart [ ext + 1 ] ) ) {
nameoffile [ nameptr ] = chr ( strpool [ pptr ] ) ;
incr ( nameptr ) ;
incr ( pptr ) ;
}
namelength = namelength + ( strstart [ ext + 1 ] - strstart [ ext ] ) ;
nameoffile [ namelength ] = ' ' ;
}
void
#ifdef STDC
zaddarea (strnumber area )
#else
zaddarea ( area )
strnumber area ;
#endif
{poolpointer pptr ;
if ( ( namelength + ( strstart [ area + 1 ] - strstart [ area ] ) > 1024 ) )
{
{
(void) ReverseFPuts( logfile , "File=" ) ;
(void) FPrintFStdErr( "File=" ) ;
}
printapoolstr ( area ) ;
printstr ( nameoffile , ',' ) ;
filenmsizeoverflow () ;
}
nameptr = namelength ;
while ( ( nameptr > 0 ) ) {
nameoffile [ nameptr + ( strstart [ area + 1 ] - strstart [ area ] ) ] =
nameoffile [ nameptr ] ;
decr ( nameptr ) ;
}
nameptr = 0 ;
pptr = strstart [ area ] ;
while ( ( pptr < strstart [ area + 1 ] ) ) {
nameoffile [ nameptr ] = chr ( strpool [ pptr ] ) ;
incr ( nameptr ) ;
incr ( pptr ) ;
}
namelength = namelength + ( strstart [ area + 1 ] - strstart [ area ] ) ;
}
strnumber makestring () {
register strnumber Result; if ( ( strptr ==
maxstrings ) )
{
printoverflow () ;
{
(void) FPrintF( logfile , "%s%ld\r", "number of strings " , (long)maxstrings ) ;
(void) FPrintFStdErr( "%s%ld\r", "number of strings " , (long)maxstrings ) ;
}
longjmp(jmp9998,1) ;
}
incr ( strptr ) ;
strstart [ strptr ] = poolptr ;
Result = strptr - 1 ;
return(Result) ;
}
#ifdef STDC
boolean zstreqbuf (strnumber s ,buftype buf ,bufpointer bfptr ,bufpointer len )
#else
boolean zstreqbuf ( s , buf , bfptr , len )
strnumber s ;
buftype buf ;
bufpointer bfptr , len ;
#endif
{/* 10 */ register boolean Result; bufpointer i ;
poolpointer j ;
if ( ( ( strstart [ s + 1 ] - strstart [ s ] ) != len ) )
{
Result = false ;
goto lab10 ;
}
i = bfptr ;
j = strstart [ s ] ;
while ( ( j < strstart [ s + 1 ] ) ) {
if ( ( strpool [ j ] != buf [ i ] ) )
{
Result = false ;
goto lab10 ;
}
incr ( i ) ;
incr ( j ) ;
}
Result = true ;
lab10: ;
return(Result) ;
}
#ifdef STDC
boolean zstreqstr (strnumber s1 ,strnumber s2 )
#else
boolean zstreqstr ( s1 , s2 )
strnumber s1 , s2 ;
#endif
{/* 10 */ register boolean Result; if ( ( ( strstart [ s1 + 1 ] -
strstart [ s1 ] ) != ( strstart [ s2 + 1 ] - strstart [ s2 ] ) ) )
{
Result = false ;
goto lab10 ;
}
pptr1 = strstart [ s1 ] ;
pptr2 = strstart [ s2 ] ;
while ( ( pptr1 < strstart [ s1 + 1 ] ) ) {
if ( ( strpool [ pptr1 ] != strpool [ pptr2 ] ) )
{
Result = false ;
goto lab10 ;
}
incr ( pptr1 ) ;
incr ( pptr2 ) ;
}
Result = true ;
lab10: ;
return(Result) ;
}
void
#ifdef STDC
zlowercase (buftype buf ,bufpointer bfptr ,bufpointer len )
#else
zlowercase ( buf , bfptr , len )
buftype buf ;
bufpointer bfptr , len ;
#endif
{bufpointer i ;
if ( ( len > 0 ) )
{register integer for_end; i = bfptr ; for_end = bfptr + len - 1 ; if ( i
<= for_end) do
if ( ( ( buf [ i ] >= 65 ) && ( buf [ i ] <= 90 ) ) )
buf [ i ] = buf [ i ] + 32 ;
while ( i++ < for_end ) ; }
}
void
#ifdef STDC
zuppercase (buftype buf ,bufpointer bfptr ,bufpointer len )
#else
zuppercase ( buf , bfptr , len )
buftype buf ;
bufpointer bfptr , len ;
#endif
{bufpointer i ;
if ( ( len > 0 ) )
{register integer for_end; i = bfptr ; for_end = bfptr + len - 1 ; if ( i
<= for_end) do
if ( ( ( buf [ i ] >= 97 ) && ( buf [ i ] <= 122 ) ) )
buf [ i ] = buf [ i ] - 32 ;
while ( i++ < for_end ) ; }
}
#ifdef STDC
hashloc zstrlookup (buftype buf ,bufpointer j ,bufpointer l ,strilk ilk ,boolean insertit )
#else
hashloc zstrlookup ( buf , j , l , ilk , insertit )
buftype buf ;
bufpointer j , l ;
strilk ilk ;
boolean insertit ;
#endif
{/* 40 45 */ register hashloc Result; short h ;
hashloc p ;
bufpointer k ;
boolean oldstring ;
strnumber strnum ;
{
h = 0 ;
k = j ;
while ( ( k < j + l ) ) {
h = h + h + buf [ k ] ;
while ( ( h >= 4253 ) ) h = h - 4253 ;
incr ( k ) ;
}
}
p = h + 1 ;
hashfound = false ;
oldstring = false ;
while ( true ) {
{
if ( ( hashtext [ p ] > 0 ) )
if ( ( streqbuf ( hashtext [ p ] , buf , j , l ) ) )
if ( ( hashilk [ p ] == ilk ) )
{
hashfound = true ;
goto lab40 ;
}
else {
oldstring = true ;
strnum = hashtext [ p ] ;
}
}
if ( ( hashnext [ p ] == 0 ) )
{
if ( ( ! insertit ) )
goto lab45 ;
{
if ( ( hashtext [ p ] > 0 ) )
{
do {
if ( ( ( hashused == 1 ) ) )
{
printoverflow () ;
{
(void) FPrintF( logfile , "%s%ld\r", "hash size " , (long)5000 ) ;
(void) FPrintFStdErr( "%s%ld\r", "hash size " , (long)5000 ) ;
}
longjmp(jmp9998,1) ;
}
decr ( hashused ) ;
} while ( ! ( ( hashtext [ hashused ] == 0 ) ) ) ;
hashnext [ p ] = hashused ;
p = hashused ;
}
if ( ( oldstring ) )
hashtext [ p ] = strnum ;
else {
{
if ( ( poolptr + l > poolsize ) )
pooloverflow () ;
}
k = j ;
while ( ( k < j + l ) ) {
{
strpool [ poolptr ] = buf [ k ] ;
incr ( poolptr ) ;
}
incr ( k ) ;
}
hashtext [ p ] = makestring () ;
}
hashilk [ p ] = ilk ;
}
goto lab40 ;
}
p = hashnext [ p ] ;
}
lab45: ;
lab40: Result = p ;
return(Result) ;
}
void
#ifdef STDC
zpredefine (pdstype pds ,pdslen len ,strilk ilk )
#else
zpredefine ( pds , len , ilk )
pdstype pds ;
pdslen len ;
strilk ilk ;
#endif
{pdslen i ;
{register integer for_end; i = 1 ; for_end = len ; if ( i <= for_end) do
buffer [ i ] = xord [ pds [ i - 1 ] ] ;
while ( i++ < for_end ) ; }
predefloc = strlookup ( buffer , 1 , len , ilk , true ) ;
}
void
#ifdef STDC
zinttoASCII (integer inte ,buftype intbuf ,bufpointer intbegin ,bufpointer * intend )
#else
zinttoASCII ( inte , intbuf , intbegin , intend )
integer inte ;
buftype intbuf ;
bufpointer intbegin ;
bufpointer * intend ;
#endif
{bufpointer intptr, intxptr ;
ASCIIcode inttmpval ;
intptr = intbegin ;
if ( ( inte < 0 ) )
{
{
if ( ( intptr == bufsize ) )
bufferoverflow () ;
intbuf [ intptr ] = 45 ;
incr ( intptr ) ;
}
inte = - (integer) inte ;
}
intxptr = intptr ;
do {
{
if ( ( intptr == bufsize ) )
bufferoverflow () ;
intbuf [ intptr ] = 48 + ( inte % 10 ) ;
incr ( intptr ) ;
}
inte = inte / 10 ;
} while ( ! ( ( inte == 0 ) ) ) ;
* intend = intptr ;
decr ( intptr ) ;
while ( ( intxptr < intptr ) ) {
inttmpval = intbuf [ intxptr ] ;
intbuf [ intxptr ] = intbuf [ intptr ] ;
intbuf [ intptr ] = inttmpval ;
decr ( intptr ) ;
incr ( intxptr ) ;
}
}
void
#ifdef STDC
zadddatabasecite (citenumber * newcite )
#else
zadddatabasecite ( newcite )
citenumber * newcite ;
#endif
{checkciteoverflow ( *newcite ) ;
checkfieldoverflow ( numfields * *newcite ) ;
citelist [ *newcite ] = hashtext [ citeloc ] ;
ilkinfo [ citeloc ] = *newcite ;
ilkinfo [ lcciteloc ] = citeloc ;
incr ( *newcite ) ;
}
#ifdef STDC
boolean zfindcitelocsforthisc (strnumber citestr )
#else
boolean zfindcitelocsforthisc ( citestr )
strnumber citestr ;
#endif
{register boolean Result; exbufptr = 0 ;
tmpptr = strstart [ citestr ] ;
tmpendptr = strstart [ citestr + 1 ] ;
while ( ( tmpptr < tmpendptr ) ) {
exbuf [ exbufptr ] = strpool [ tmpptr ] ;
incr ( exbufptr ) ;
incr ( tmpptr ) ;
}
citeloc = strlookup ( exbuf , 0 , ( strstart [ citestr + 1 ] - strstart [
citestr ] ) , 9 , false ) ;
citehashfound = hashfound ;
lowercase ( exbuf , 0 , ( strstart [ citestr + 1 ] - strstart [ citestr ] )
) ;
lcciteloc = strlookup ( exbuf , 0 , ( strstart [ citestr + 1 ] - strstart [
citestr ] ) , 10 , false ) ;
if ( ( hashfound ) )
Result = true ;
else Result = false ;
return(Result) ;
}
void
#ifdef STDC
zswap (citenumber swap1 ,citenumber swap2 )
#else
zswap ( swap1 , swap2 )
citenumber swap1 , swap2 ;
#endif
{citenumber innocentbystander ;
innocentbystander = citeinfo [ swap2 ] ;
citeinfo [ swap2 ] = citeinfo [ swap1 ] ;
citeinfo [ swap1 ] = innocentbystander ;
}
#ifdef STDC
boolean zlessthan (citenumber arg1 ,citenumber arg2 )
#else
boolean zlessthan ( arg1 , arg2 )
citenumber arg1 , arg2 ;
#endif
{/* 10 */ register boolean Result; integer charptr ;
strentloc ptr1, ptr2 ;
ASCIIcode char1, char2 ;
ptr1 = arg1 * numentstrs + sortkeynum ;
ptr2 = arg2 * numentstrs + sortkeynum ;
charptr = 0 ;
while ( true ) {
char1 = entrystrs [ ptr1 ] [ charptr ] ;
char2 = entrystrs [ ptr2 ] [ charptr ] ;
if ( ( char1 == 127 ) )
if ( ( char2 == 127 ) )
if ( ( arg1 < arg2 ) )
{
Result = true ;
goto lab10 ;
}
else if ( ( arg1 > arg2 ) )
{
Result = false ;
goto lab10 ;
}
else {
{
(void) ReverseFPuts( logfile , "Duplicate sort key" ) ;
(void) FPrintFStdErr( "Duplicate sort key" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
else {
Result = true ;
goto lab10 ;
}
else if ( ( char2 == 127 ) )
{
Result = false ;
goto lab10 ;
}
else if ( ( char1 < char2 ) )
{
Result = true ;
goto lab10 ;
}
else if ( ( char1 > char2 ) )
{
Result = false ;
goto lab10 ;
}
incr ( charptr ) ;
}
lab10: ;
return(Result) ;
}
void
#ifdef STDC
zquicksort (citenumber leftend ,citenumber rightend )
#else
zquicksort ( leftend , rightend )
citenumber leftend , rightend ;
#endif
{/* 24 */ citenumber left, right ;
citenumber insertptr ;
citenumber middle ;
citenumber partition ;
;
#ifdef TRACE
{
(void) FPrintF( logfile , "%s%ld%s%ld\r", "Sorting " , (long)leftend , " through " , (long)rightend ) ;
}
#endif /* TRACE */
if ( ( rightend - leftend < 10 ) )
{
{register integer for_end; insertptr = leftend + 1 ; for_end = rightend
; if ( insertptr <= for_end) do
{
{register integer for_end; right = insertptr ; for_end = leftend + 1
; if ( right >= for_end) do
{
if ( ( lessthan ( citeinfo [ right - 1 ] , citeinfo [ right ] ) )
)
goto lab24 ;
swap ( right - 1 , right ) ;
}
while ( right-- > for_end ) ; }
lab24: ;
}
while ( insertptr++ < for_end ) ; }
}
else {
{
left = leftend + 4 ;
middle = ( leftend + rightend ) / 2 ;
right = rightend - 4 ;
if ( ( lessthan ( citeinfo [ left ] , citeinfo [ middle ] ) ) )
if ( ( lessthan ( citeinfo [ middle ] , citeinfo [ right ] ) ) )
swap ( leftend , middle ) ;
else if ( ( lessthan ( citeinfo [ left ] , citeinfo [ right ] ) ) )
swap ( leftend , right ) ;
else swap ( leftend , left ) ;
else if ( ( lessthan ( citeinfo [ right ] , citeinfo [ middle ] ) ) )
swap ( leftend , middle ) ;
else if ( ( lessthan ( citeinfo [ right ] , citeinfo [ left ] ) ) )
swap ( leftend , right ) ;
else swap ( leftend , left ) ;
}
{
partition = citeinfo [ leftend ] ;
left = leftend + 1 ;
right = rightend ;
do {
while ( ( lessthan ( citeinfo [ left ] , partition ) ) ) incr (
left ) ;
while ( ( lessthan ( partition , citeinfo [ right ] ) ) ) decr ( right
) ;
if ( ( left < right ) )
{
swap ( left , right ) ;
incr ( left ) ;
decr ( right ) ;
}
} while ( ! ( ( left == right + 1 ) ) ) ;
swap ( leftend , right ) ;
quicksort ( leftend , right - 1 ) ;
quicksort ( left , rightend ) ;
}
}
}
#include "BibTeX.h"
#include "BibTeX.p"
#include "globals.h"
#include "coerce.h"
void printanewline (void) {
(void) FPutC('\r', logfile );
(void) FPutC('\r');
#ifdef GIVE_UP_TIME
give_up_some_time();
#endif
}
void markwarning (void) {
if ( ( history == 1 ) )
incr ( errcount ) ;
else if ( ( history == 0 ) )
{
history = 1 ;
errcount = 1 ;
}
}
void markerror (void) {
if ( ( history < 2 ) )
{
history = 2 ;
errcount = 1 ;
}
else incr ( errcount ) ;
}
void markfatal (void) {
history = 3 ;
}
void printoverflow (void) {
{
(void) ReverseFPuts( logfile , "Sorry---you've exceeded BibTeX's " ) ;
(void) FPrintFStdErr( "Sorry---you've exceeded BibTeX's " ) ;
}
markfatal () ;
}
void printconfusion (void) {
{
(void) FPrintF( logfile , "%s\r", "---this can't happen" ) ;
(void) FPrintFStdErr( "%s\r", "---this can't happen" ) ;
}
{
(void) FPrintF( logfile , "%s\r", "*Please notify the BibTeX maintainer*" ) ;
(void) FPrintFStdErr( "%s\r", "*Please notify the BibTeX maintainer*" ) ;
}
markfatal () ;
}
void bufferoverflow (void) {
{
printoverflow () ;
{
(void) FPrintF( logfile , "%s%ld\r", "buffer size " , (long)bufsize ) ;
(void) FPrintFStdErr( "%s%ld\r", "buffer size " , (long)bufsize ) ;
}
longjmp(jmp9998,1) ;
}
}
#ifdef STDC
boolean zinputln (alphafile f )
#else
boolean zinputln ( f )
alphafile f ;
#endif
{/* 15 */ register boolean Result; last = 0 ;
if ( eof ( f ) )
Result = false ;
else {
lineread ( f , bufsize ) ;
if ( last >= bufsize )
{
printoverflow () ;
{
(void) FPrintF( logfile , "%s%ld\r", "buffer size " , (long)bufsize ) ;
(void) FPrintFStdErr( "%s%ld\r", "buffer size " , (long)bufsize ) ;
}
longjmp(jmp9998,1) ;
}
while ( ( last > 0 ) ) if ( lexclass [ buffer [ last - 1 ] ] == 1 )
decr ( last ) ;
else goto lab15 ;
lab15: Result = true ;
}
return(Result) ;
}
void
#ifdef STDC
zoutpoolstr (alphafile f ,strnumber s )
#else
zoutpoolstr ( f , s )
alphafile f ;
strnumber s ;
#endif
{
poolpointer i ;
if ( ( ( s < 0 ) || ( s >= strptr + 3 ) || ( s >= maxstrings ) ) )
{
{
(void) FPrintF( logfile , "%s%ld", "Illegal string number:" , (long)s ) ;
(void) FPrintFStdErr( "%s%ld", "Illegal string number:" , (long)s ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
{register integer for_end; i = strstart [ s ] ; for_end = strstart [ s + 1
] - 1 ; if ( i <= for_end) do
(void) FPutC( xchr [ strpool [ i ] ] , f );
while ( i++ < for_end ) ; }
}
void
#ifdef STDC
zprintapoolstr (strnumber s )
#else
zprintapoolstr ( s )
strnumber s ;
#endif
{
outpoolstr ( stdout , s ) ;
outpoolstr ( logfile , s ) ;
}
void pooloverflow (void) {
{
printoverflow () ;
{
(void) FPrintF( logfile , "%s%ld\r", "pool size " , (long)poolsize ) ;
(void) FPrintFStdErr( "%s%ld\r", "pool size " , (long)poolsize ) ;
}
longjmp(jmp9998,1) ;
}
}
void filenmsizeoverflow (void) {
{
printoverflow () ;
{
(void) FPrintF( logfile , "%s%ld\r", "file name size " , (long)1024 ) ;
(void) FPrintFStdErr( "%s%ld\r", "file name size " , (long)1024 ) ;
}
longjmp(jmp9998,1) ;
}
}
void
#ifdef STDC
zouttoken (alphafile f )
#else
zouttoken ( f )
alphafile f ;
#endif
{bufpointer i ;
i = bufptr1 ;
while ( ( i < bufptr2 ) ) {
(void) FPutC( xchr [ buffer [ i ] ] , f );
incr ( i ) ;
}
}
void printatoken (void) {
outtoken ( stdout ) ;
outtoken ( logfile ) ;
}
void printbadinputline (void) {
bufpointer bfptr ;
{
(void) ReverseFPuts( logfile , " : " ) ;
(void) FPrintFStdErr( " : " ) ;
}
bfptr = 0 ;
while ( ( bfptr < bufptr2 ) ) {
if ( ( lexclass [ buffer [ bfptr ] ] == 1 ) )
{
(void) FPutC( xchr [ 32 ] , logfile );
(void) FPutC( xchr [ 32 ] );
}
else {
(void) FPutC( xchr [ buffer [ bfptr ] ] , logfile );
(void) FPutC( xchr [ buffer [ bfptr ] ] );
}
incr ( bfptr ) ;
}
printanewline () ;
{
(void) ReverseFPuts( logfile , " : " ) ;
(void) FPrintFStdErr( " : " ) ;
}
bfptr = 0 ;
while ( ( bfptr < bufptr2 ) ) {
{
(void) FPutC( xchr [ 32 ] , logfile );
(void) FPutC( xchr [ 32 ] );
}
incr ( bfptr ) ;
}
bfptr = bufptr2 ;
while ( ( bfptr < last ) ) {
if ( ( lexclass [ buffer [ bfptr ] ] == 1 ) )
{
(void) FPutC( xchr [ 32 ] , logfile );
(void) FPutC( xchr [ 32 ] );
}
else {
(void) FPutC( xchr [ buffer [ bfptr ] ] , logfile );
(void) FPutC( xchr [ buffer [ bfptr ] ] );
}
incr ( bfptr ) ;
}
printanewline () ;
bfptr = 0 ;
while ( ( ( bfptr < bufptr2 ) && ( lexclass [ buffer [ bfptr ] ] == 1 ) ) )
incr ( bfptr ) ;
if ( ( bfptr == bufptr2 ) )
{
(void) FPrintF( logfile , "%s\r", "(Error may have been on previous line)" ) ;
(void) FPrintFStdErr( "%s\r", "(Error may have been on previous line)" ) ;
}
markerror () ;
}
void printskippingwhateve (void) {
{
(void) ReverseFPuts( logfile , "I'm skipping whatever remains of this " ) ;
(void) FPrintFStdErr( "I'm skipping whatever remains of this " ) ;
}
}
void samtoolongfilenamepr (void) {
(void) FPrintFStdErr( "File name `" ) ;
nameptr = 0 ;
while ( ( nameptr < auxnamelength ) ) {
(void) FPutC( nameoffile [ nameptr ] );
incr ( nameptr ) ;
}
(void) FPrintFStdErr( "%s\r", "' is too long" ) ;
}
void samwrongfilenameprin (void) {
(void) FPrintFStdErr( "I couldn't open file name `" ) ;
nameptr = 0 ;
while ( ( nameptr < namelength ) ) {
(void) FPutC( nameoffile [ nameptr ] );
incr ( nameptr ) ;
}
(void) FPrintFStdErr( "%c\r", '\'' ) ;
}
void printauxname (void) {
printapoolstr ( auxlist [ auxptr ] ) ;
printanewline () ;
}
void auxerrprint (void) {
{
(void) FPrintF( logfile , "%s%ld%s", "---line " , (long)auxlnstack [ auxptr ] , " of file " ) ;
(void) FPrintFStdErr( "%s%ld%s", "---line " , (long)auxlnstack [ auxptr ] , " of file " ) ;
}
printauxname () ;
printbadinputline () ;
printskippingwhateve () ;
{
(void) FPrintF( logfile , "%s\r", "command" ) ;
(void) FPrintFStdErr( "%s\r", "command" ) ;
}
}
void
#ifdef STDC
zauxerrillegalanother (integer cmdnum )
#else
zauxerrillegalanother ( cmdnum )
integer cmdnum ;
#endif
{{
(void) ReverseFPuts( logfile , "Illegal, another \\bib" ) ;
(void) FPrintFStdErr( "Illegal, another \\bib" ) ;
}
switch ( ( cmdnum ) )
{case 0 :
{
(void) ReverseFPuts( logfile , "data" ) ;
(void) FPrintFStdErr( "data" ) ;
}
break ;
case 1 :
{
(void) ReverseFPuts( logfile , "style" ) ;
(void) FPrintFStdErr( "style" ) ;
}
break ;
default:
{
{
(void) ReverseFPuts( logfile , "Illegal auxiliary-file command" ) ;
(void) FPrintFStdErr( "Illegal auxiliary-file command" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
break ;
}
{
(void) ReverseFPuts( logfile , " command" ) ;
(void) FPrintFStdErr( " command" ) ;
}
}
void auxerrnorightbracepr (void) {
{
(void) FPrintF( logfile , "%s%c%c", "No \"" , xchr [ 125 ] , '"' ) ;
(void) FPrintFStdErr( "%s%c%c", "No \"" , xchr [ 125 ] , '"' ) ;
}
}
void auxerrstuffafterrigh (void) {
{
(void) FPrintF( logfile , "%s%c%c", "Stuff after \"" , xchr [ 125 ] , '"' ) ;
(void) FPrintFStdErr( "%s%c%c", "Stuff after \"" , xchr [ 125 ] , '"' ) ;
}
}
void auxerrwhitespaceinar (void) {
{
(void) ReverseFPuts( logfile , "White space in argument" ) ;
(void) FPrintFStdErr( "White space in argument" ) ;
}
}
void printbibname (void) {
printapoolstr ( biblist [ bibptr ] ) ;
printapoolstr ( sbibextension ) ;
printanewline () ;
}
void printbstname (void) {
printapoolstr ( bststr ) ;
printapoolstr ( sbstextension ) ;
printanewline () ;
}
void hashciteconfusion (void) {
{
{
(void) ReverseFPuts( logfile , "Cite hash error" ) ;
(void) FPrintFStdErr( "Cite hash error" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
}
void
#ifdef STDC
zcheckciteoverflow (citenumber lastcite )
#else
zcheckciteoverflow ( lastcite )
citenumber lastcite ;
#endif
{if ( ( lastcite == maxcites ) )
{
printapoolstr ( hashtext [ citeloc ] ) ;
{
(void) FPrintF( logfile , "%s\r", " is the key:" ) ;
(void) FPrintFStdErr( "%s\r", " is the key:" ) ;
}
{
printoverflow () ;
{
(void) FPrintF( logfile , "%s%ld\r", "number of cite keys " , (long)maxcites ) ;
(void) FPrintFStdErr( "%s%ld\r", "number of cite keys " , (long)maxcites ) ;
}
longjmp(jmp9998,1) ;
}
}
}
void auxend1errprint (void) {
{
(void) ReverseFPuts( logfile , "I found no " ) ;
(void) FPrintFStdErr( "I found no " ) ;
}
}
void auxend2errprint (void) {
{
(void) ReverseFPuts( logfile , "---while reading file " ) ;
(void) FPrintFStdErr( "---while reading file " ) ;
}
printauxname () ;
markerror () ;
}
void bstlnnumprint (void) {
{
(void) FPrintF( logfile , "%s%ld%s", "--line " , (long)bstlinenum , " of file " ) ;
(void) FPrintFStdErr( "%s%ld%s", "--line " , (long)bstlinenum , " of file " ) ;
}
printbstname () ;
}
void bsterrprintandlookfo (void) {
{
(void) FPutC( '-' , logfile );
(void) FPutC( '-' );
}
bstlnnumprint () ;
printbadinputline () ;
while ( ( last != 0 ) ) if ( ( ! inputln ( bstfile ) ) )
longjmp(jmp32,1) ;
else incr ( bstlinenum ) ;
bufptr2 = last ;
}
void bstwarnprint (void) {
bstlnnumprint () ;
markwarning () ;
}
void eatbstprint (void) {
{
(void) ReverseFPuts( logfile , "Illegal end of style file in command: " ) ;
(void) FPrintFStdErr( "Illegal end of style file in command: " ) ;
}
}
void unknwnfunctionclassc (void) {
{
{
(void) ReverseFPuts( logfile , "Unknown function class" ) ;
(void) FPrintFStdErr( "Unknown function class" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
}
void
#ifdef STDC
zprintfnclass (hashloc fnloc )
#else
zprintfnclass ( fnloc )
hashloc fnloc ;
#endif
{switch ( ( fntype [ fnloc ] ) )
{case 0 :
{
(void) ReverseFPuts( logfile , "built-in" ) ;
(void) FPrintFStdErr( "built-in" ) ;
}
break ;
case 1 :
{
(void) ReverseFPuts( logfile , "wizard-defined" ) ;
(void) FPrintFStdErr( "wizard-defined" ) ;
}
break ;
case 2 :
{
(void) ReverseFPuts( logfile , "integer-literal" ) ;
(void) FPrintFStdErr( "integer-literal" ) ;
}
break ;
case 3 :
{
(void) ReverseFPuts( logfile , "string-literal" ) ;
(void) FPrintFStdErr( "string-literal" ) ;
}
break ;
case 4 :
{
(void) ReverseFPuts( logfile , "field" ) ;
(void) FPrintFStdErr( "field" ) ;
}
break ;
case 5 :
{
(void) ReverseFPuts( logfile , "integer-entry-variable" ) ;
(void) FPrintFStdErr( "integer-entry-variable" ) ;
}
break ;
case 6 :
{
(void) ReverseFPuts( logfile , "string-entry-variable" ) ;
(void) FPrintFStdErr( "string-entry-variable" ) ;
}
break ;
case 7 :
{
(void) ReverseFPuts( logfile , "integer-global-variable" ) ;
(void) FPrintFStdErr( "integer-global-variable" ) ;
}
break ;
case 8 :
{
(void) ReverseFPuts( logfile , "string-global-variable" ) ;
(void) FPrintFStdErr( "string-global-variable" ) ;
}
break ;
default:
unknwnfunctionclassc () ;
break ;
}
}
#ifdef TRACE
void
#ifdef STDC
ztraceprfnclass (hashloc fnloc )
#else
ztraceprfnclass ( fnloc )
hashloc fnloc ;
#endif
{
switch ( ( fntype [ fnloc ] ) )
{case 0 :
{
(void) ReverseFPuts( logfile , "built-in" ) ;
}
break ;
case 1 :
{
(void) ReverseFPuts( logfile , "wizard-defined" ) ;
}
break ;
case 2 :
{
(void) ReverseFPuts( logfile , "integer-literal" ) ;
}
break ;
case 3 :
{
(void) ReverseFPuts( logfile , "string-literal" ) ;
}
break ;
case 4 :
{
(void) ReverseFPuts( logfile , "field" ) ;
}
break ;
case 5 :
{
(void) ReverseFPuts( logfile , "integer-entry-variable" ) ;
}
break ;
case 6 :
{
(void) ReverseFPuts( logfile , "string-entry-variable" ) ;
}
break ;
case 7 :
{
(void) ReverseFPuts( logfile , "integer-global-variable" ) ;
}
break ;
case 8 :
{
(void) ReverseFPuts( logfile , "string-global-variable" ) ;
}
break ;
default:
unknwnfunctionclassc () ;
break ;
}
}
#endif /* TRACE */
void idscanningconfusion (void) {
{
{
(void) ReverseFPuts( logfile , "Identifier scanning error" ) ;
(void) FPrintFStdErr( "Identifier scanning error" ) ;
}
printconfusion () ;
longjmp(jmp9998,1) ;
}
}
void bstidprint (void) {
if ( ( scanresult == 0 ) )
{
(void) FPrintF( logfile , "%c%c%s%ld", '"' , xchr [ buffer [ bufptr2 ] ] , "\" begins identifier, (long)command: " ) ;
(void) FPrintFStdErr( "%c%c%s%ld", '"' , xchr [ buffer [ bufptr2 ] ] , "\" begins identifier, (long)command: " ) ;
}
else if ( ( scanresult == 2 ) )
{
(void) FPrintF( logfile , "%c%c%s%ld", '"' , xchr [ buffer [ bufptr2 ] ] , "\" immediately follows identifier, (long)command: " ) ;
(void) FPrintFStdErr( "%c%c%s%ld", '"' , xchr [ buffer [ bufptr2 ] ] , "\" immediately follows identifier, (long)command: " ) ;
}
else idscanningconfusion () ;
}
void bstleftbraceprint (void) {
{
(void) FPrintF( logfile , "%c%c%s", '"' , xchr [ 123 ] , "\" is missing in command: " ) ;
(void) FPrintFStdErr( "%c%c%s", '"' , xchr [ 123 ] , "\" is missing in command: " ) ;
}
}
void bstrightbraceprint (void) {
{
(void) FPrintF( logfile , "%c%c%s", '"' , xchr [ 125 ] , "\" is missing in command: " ) ;
(void) FPrintFStdErr( "%c%c%s", '"' , xchr [ 125 ] , "\" is missing in command: " ) ;
}
}
void
#ifdef STDC
zalreadyseenfunctionp (hashloc seenfnloc )
#else
zalreadyseenfunctionp ( seenfnloc )
hashloc seenfnloc ;
#endif
{/* 10 */ printapoolstr ( hashtext [ seenfnloc ] ) ;
{
(void) ReverseFPuts( logfile , " is already a type \"" ) ;
(void) FPrintFStdErr( " is already a type \"" ) ;
}
printfnclass ( seenfnloc ) ;
{
(void) FPrintF( logfile , "%s\r", "\" function name" ) ;
(void) FPrintFStdErr( "%s\r", "\" function name" ) ;
}
{
bsterrprintandlookfo () ;
goto lab10 ;
}
lab10: ;
}
void singlfnoverflow (void) {
{
printoverflow () ;
{
(void) FPrintF( logfile , "%s%ld\r", "single function space " , (long)singlefnspace ) ;
(void) FPrintFStdErr( "%s%ld\r", "single function space " , (long)singlefnspace ) ;
}
longjmp(jmp9998,1) ;
}
}
void biblnnumprint (void) {
{
(void) FPrintF( logfile , "%s%ld%s", "--line " , (long)biblinenum , " of file " ) ;
(void) FPrintFStdErr( "%s%ld%s", "--line " , (long)biblinenum , " of file " ) ;
}
printbibname () ;
}
void biberrprint (void) {
{
(void) FPutC( '-' , logfile );
(void) FPutC( '-' );
}
biblnnumprint () ;
printbadinputline () ;
printskippingwhateve () ;
if ( ( atbibcommand ) )
{
(void) FPrintF( logfile , "%s\r", "command" ) ;
(void) FPrintFStdErr( "%s\r", "command" ) ;
}
else {
(void) FPrintF( logfile , "%s\r", "entry" ) ;
(void) FPrintFStdErr( "%s\r", "entry" ) ;
}
}
void bibwarnprint (void) {
biblnnumprint () ;
markwarning () ;
}
void
#ifdef STDC
zcheckfieldoverflow (integer totalfields )
#else
zcheckfieldoverflow ( totalfields )
integer totalfields ;
#endif
{if ( ( totalfields > maxfields ) )
{
{
(void) FPrintF( logfile , "%ld%s\r", (long)totalfields , " fields:" ) ;
(void) FPrintFStdErr( "%ld%s\r", (long)totalfields , " fields:" ) ;
}
{
printoverflow () ;
{
(void) FPrintF( logfile , "%s%ld\r", "total number of fields " , (long)maxfields ) ;
(void) FPrintFStdErr( "%s%ld\r", "total number of fields " , (long)maxfields ) ;
}
longjmp(jmp9998,1) ;
}
}
}
void eatbibprint (void) {
/* 10 */ {
{
(void) ReverseFPuts( logfile , "Illegal end of database file" ) ;
(void) FPrintFStdErr( "Illegal end of database file" ) ;
}
biberrprint () ;
goto lab10 ;
}
lab10: ;
}
void
#ifdef STDC
zbiboneoftwoprint (ASCIIcode char1 ,ASCIIcode char2 )
#else
zbiboneoftwoprint ( char1 , char2 )
ASCIIcode char1 , char2 ;
#endif
{/* 10 */ {
{
(void) FPrintF( logfile , "%s%c%s%c%c", "I was expecting a `" , xchr [ char1 ] , "' or a `" , xchr [ char2 ] , '\'' ) ;
(void) FPrintFStdErr( "%s%c%s%c%c", "I was expecting a `" , xchr [ char1 ] , "' or a `" , xchr [ char2 ] , '\'' ) ;
}
biberrprint () ;
goto lab10 ;
}
lab10: ;
}
void bibequalssignprint (void) {
/* 10 */ {
{
(void) FPrintF( logfile , "%s%c%c", "I was expecting an \"" , xchr [ 61 ] , '"' ) ;
(void) FPrintFStdErr( "%s%c%c", "I was expecting an \"" , xchr [ 61 ] , '"' ) ;
}
biberrprint () ;
goto lab10 ;
}
lab10: ;
}
void bibunbalancedbracesp (void) {
/* 10 */ {
{
(void) ReverseFPuts( logfile , "Unbalanced braces" ) ;
(void) FPrintFStdErr( "Unbalanced braces" ) ;
}
biberrprint () ;
goto lab10 ;
}
lab10: ;
}
void bibfieldtoolongprint (void) {
/* 10 */ {
{
(void) FPrintF( logfile , "%s%ld%s", "Your field is more than " , (long)bufsize , " characters" )
;
(void) FPrintFStdErr( "%s%ld%s", "Your field is more than " , (long)bufsize , " characters" )
;
}
biberrprint () ;
goto lab10 ;
}
lab10: ;
}
void macrowarnprint (void) {
{
(void) ReverseFPuts( logfile , "Warning--string name \"" ) ;
(void) FPrintFStdErr( "Warning--string name \"" ) ;
}
printatoken () ;
{
(void) ReverseFPuts( logfile , "\" is " ) ;
(void) FPrintFStdErr( "\" is " ) ;
}
}
#pragma profile reset